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: @tevm/whatsabi #1345

Merged
merged 21 commits into from
Aug 12, 2024
Merged

Conversation

roninjin10
Copy link
Collaborator

@roninjin10 roninjin10 commented Jul 27, 2024

Description

Concise description of proposed changes

Testing

Explain the quality checks that have been done on the code changes

Additional Information

Your ENS/address:

Summary by CodeRabbit

  • New Features

    • Added a .gitignore file to streamline repository management by excluding unnecessary files.
    • Introduced a LICENSE file, specifying the terms of using the software under the MIT License.
    • Launched a README.md for the @tevm/whatsabi package, providing essential documentation and usage information.
    • Implemented new modules for handling Ethereum contract URIs, enhancing blockchain interaction capabilities.
    • Established a comprehensive package.json for managing dependencies and configurations for the @tevm/whatsabi package.
    • Introduced functionality for resolving contract URIs, including error handling for unknown chains.
  • Configuration Updates

    • Introduced a .depcheckrc file to manage dependency checks flexibly.
    • Added a biome.json file for code formatting and linting configurations.
  • Code Quality Enhancements

    • Added comprehensive type definitions to ensure type safety and clarity when working with blockchain data.

Copy link

vercel bot commented Jul 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
tevm-monorepo-tevm ⬜️ Ignored (Inspect) Aug 11, 2024 11:54pm

Copy link

changeset-bot bot commented Jul 27, 2024

⚠️ No Changeset found

Latest commit: 8b608fd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Jul 27, 2024

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

160 files out of 278 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The recent updates to the bundler-packages/whatsabi directory introduce a comprehensive set of enhancements aimed at improving the usability and maintainability of Ethereum contract interactions. Key additions include a .gitignore for effective repository management, a detailed README.md for user guidance, and a LICENSE for legal clarity. New TypeScript definitions and utility functions streamline URI handling and contract resolution, while various configuration files enhance the development workflow.

Changes

File Path Change Summary
bundler-packages/whatsabi/.gitignore New file specifying ignored files and directories for Git.
bundler-packages/whatsabi/LICENSE New MIT License file outlining usage rights and terms.
bundler-packages/whatsabi/README.md New documentation file providing an overview of the @tevm/whatsabi package.
bundler-packages/whatsabi/biome.json New configuration for the Biome tool, defining formatting and linting rules.
bundler-packages/whatsabi/package.json New file detailing package metadata, dependencies, and module export entry points.
bundler-packages/whatsabi/src/*.ts New TypeScript files introducing types for contract URIs, chain IDs, and parsing logic.
bundler-packages/whatsabi/src/*.js New JavaScript files for regular expressions and utilities related to contract URIs.
bundler-packages/whatsabi/.depcheckrc New file specifying dependencies to ignore during analysis and settings for handling missing dependencies.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ContractUriParser
    participant ContractUriResolver
    participant Whatsabi

    User->>ContractUriParser: Provide contract URI
    ContractUriParser->>ContractUriResolver: Parse URI components
    ContractUriResolver->>Whatsabi: Resolve contract details
    Whatsabi-->>ContractUriResolver: Return ABI, address, bytecode
    ContractUriResolver-->>User: Provide contract information
Loading

Poem

🐇 In a world of chains and smart contracts bright,
A rabbit hops forth, with joy and delight!
New tools and configs, oh what a treat,
For handling URIs, they can't be beat!
With code so refined, and structure so grand,
Let's dance with the data, hand in paw, we stand! 🌟


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.

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @roninjin10 and the rest of your teammates on Graphite Graphite

@roninjin10 roninjin10 marked this pull request as ready for review July 27, 2024 22:06
@roninjin10 roninjin10 changed the title ✨ Feat: Whatsabi imports 📦 Feat: @tevm/whatsabi Jul 27, 2024
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: 7

Outside diff range, codebase verification and nitpick comments (2)
bundler-packages/whatsabi/src/parseUri.js (1)

1-2: Consider organizing imports.

Organizing imports can improve readability and maintainability. Group related imports together.

import { getAddress } from '@tevm/utils'
import { contractUriPattern } from './contractUriPattern.js'
bundler-packages/whatsabi/src/whatsAbiTevmAdapter.js (1)

7-21: Ensure error message provides actionable guidance.

The error message should provide clear and actionable guidance for the user.

- `Unknown chain ID: ${chainId}. No default rpc known. Please pass in a valid rpc url as a query string \`?rpcUrl=${rpcUrl}\` or open a pr to viem to add your chain to viem/chains`,
+ `Unknown chain ID: ${chainId}. No default RPC known. Please pass in a valid RPC URL as a query string \`?rpcUrl=<your_rpc_url>\` or open a PR to viem to add your chain to viem/chains.`,
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a6bda73 and 297fbeb.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (18)
  • bundler-packages/whatsabi/.gitignore (1 hunks)
  • bundler-packages/whatsabi/LICENSE (1 hunks)
  • bundler-packages/whatsabi/README.md (1 hunks)
  • bundler-packages/whatsabi/biome.json (1 hunks)
  • bundler-packages/whatsabi/package.json (1 hunks)
  • bundler-packages/whatsabi/src/ContractUri.ts (1 hunks)
  • bundler-packages/whatsabi/src/KnownChainIds.ts (1 hunks)
  • bundler-packages/whatsabi/src/KnownChainsType.ts (1 hunks)
  • bundler-packages/whatsabi/src/ParsedUri.ts (1 hunks)
  • bundler-packages/whatsabi/src/contractUriPattern.js (1 hunks)
  • bundler-packages/whatsabi/src/index.ts (1 hunks)
  • bundler-packages/whatsabi/src/knownChains.js (1 hunks)
  • bundler-packages/whatsabi/src/parseUri.js (1 hunks)
  • bundler-packages/whatsabi/src/whatsAbiTevmAdapter.js (1 hunks)
  • bundler-packages/whatsabi/tsconfig.json (1 hunks)
  • bundler-packages/whatsabi/tsup.config.ts (1 hunks)
  • bundler-packages/whatsabi/typedoc.json (1 hunks)
  • bundler-packages/whatsabi/vitest.config.ts (1 hunks)
Files skipped from review due to trivial changes (10)
  • bundler-packages/whatsabi/.gitignore
  • bundler-packages/whatsabi/LICENSE
  • bundler-packages/whatsabi/README.md
  • bundler-packages/whatsabi/package.json
  • bundler-packages/whatsabi/src/KnownChainIds.ts
  • bundler-packages/whatsabi/src/contractUriPattern.js
  • bundler-packages/whatsabi/src/index.ts
  • bundler-packages/whatsabi/tsup.config.ts
  • bundler-packages/whatsabi/typedoc.json
  • bundler-packages/whatsabi/vitest.config.ts
Additional context used
Biome
bundler-packages/whatsabi/src/parseUri.js

[error] 14-14: Use Number.parseInt instead of the equivalent global.

ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.

(lint/style/useNumberNamespace)

Additional comments not posted (15)
bundler-packages/whatsabi/src/ContractUri.ts (1)

1-4: LGTM!

The type definition for ContractUri is well-structured and leverages TypeScript's template literal types effectively.

bundler-packages/whatsabi/tsconfig.json (1)

1-10: LGTM!

The TypeScript configuration settings are standard and align with best practices.

bundler-packages/whatsabi/src/ParsedUri.ts (1)

1-11: LGTM!

The type definition for ParsedUri is comprehensive and covers various aspects of Ethereum contract URIs.

bundler-packages/whatsabi/src/parseUri.js (1)

15-15: Ensure getAddress handles invalid addresses.

Verify that getAddress handles invalid addresses appropriately to avoid potential issues.

Verification successful

Verified that getAddress handles invalid addresses appropriately.

The getAddress function checks if the address is valid using isAddress and throws an InvalidAddressError if it is not, ensuring proper error handling for invalid addresses.

  • experimental/viem-effect/src-viem/_esm/utils/address/getAddress.js
  • experimental/viem-effect/src-viem/_cjs/utils/address/getAddress.js
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that `getAddress` handles invalid addresses appropriately.

# Test: Search for the function implementation. Expect: Proper error handling for invalid addresses.
rg --type js -A 5 $'function getAddress'

Length of output: 2388

bundler-packages/whatsabi/biome.json (4)

37-43: Ensure formatter settings meet project standards.

Verify that the formatter settings align with the project's coding standards.

Verification successful

Formatter settings in bundler-packages/whatsabi/biome.json align with project standards.

The formatter settings in bundler-packages/whatsabi/biome.json are consistent with those in other biome.json files across the project, indicating adherence to the project's coding standards.

  • enabled: true
  • formatWithErrors: false
  • indentStyle: tab
  • indentWidth: 2
  • lineWidth: 120
  • quoteStyle: single
  • trailingCommas: all
  • semicolons: asNeeded
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify formatter settings.

# Test: Search for project coding standards. Expect: Alignment with formatter settings.
rg --type json -A 5 $'formatter'

Length of output: 34394


44-67: Ensure linter settings meet project standards.

Verify that the linter settings align with the project's coding standards.

Verification successful

Linter settings verified

The linter settings in bundler-packages/whatsabi/biome.json align with the project's standards as indicated by the consistency across multiple biome.json files and the CONTRIBUTING.md file in the project.

  • bundler-packages/whatsabi/biome.json
  • bundler-packages/config/CONTRIBUTING.md
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify linter settings.

# Test: Search for project coding standards. Expect: Alignment with linter settings.
rg --type json -A 5 $'linter'

Length of output: 16814


Script:

#!/bin/bash
# Description: Search for central linter configuration or documentation in the project.

# Search for any central linter configuration file or documentation that might define the project's linter standards.
rg --files | grep -E 'linter|lint|eslint|biome|config|readme|docs' | xargs rg -i 'linter|lint|rules|standards'

Length of output: 111912


70-75: Ensure JavaScript formatter settings meet project standards.

Verify that the JavaScript formatter settings align with the project's coding standards.


3-5: Ensure import organization settings meet project standards.

Verify that the import organization settings align with the project's coding standards.

bundler-packages/whatsabi/src/whatsAbiTevmAdapter.js (1)

39-42: Ensure createClient handles missing rpcUrl.

Verify that createClient handles cases where rpcUrl is missing.

Verification successful

Verified: createClient handles missing rpcUrl appropriately.

The http function, used as the transport in createClient, throws a UrlRequiredError if the url parameter is missing, ensuring that createClient handles the case where rpcUrl is missing.

  • experimental/viem-effect/src-viem/_esm/clients/transports/http.js
  • experimental/viem-effect/src-viem/_cjs/clients/transports/http.js
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that `createClient` handles missing `rpcUrl` appropriately.

# Test: Search for the function implementation. Expect: Proper error handling for missing `rpcUrl`.
rg --type js -A 5 $'function createClient'

Length of output: 1097


Script:

#!/bin/bash
# Extract the full implementation of the `createClient` function from both files.

# Extract the full function from the first file
ast-grep --lang javascript --pattern $'function createClient($_) { $$$ }' experimental/viem-effect/src-viem/_esm/clients/createClient.js

# Extract the full function from the second file
ast-grep --lang javascript --pattern $'function createClient($_) { $$$ }' experimental/viem-effect/src-viem/_cjs/clients/createClient.js

Length of output: 7536


Script:

#!/bin/bash
# Locate and extract the implementation of the `parameters.transport` function or method.

# Search for the definition of the transport function
rg --type js 'function transport' -A 10

# Search for the definition of the transport method
rg --type js 'transport: function' -A 10

Length of output: 84


Script:

#!/bin/bash
# Search for the usage and definition of the `transport` keyword in the files where `createClient` is defined.

# Search for `transport` in the first file
rg --type js 'transport' experimental/viem-effect/src-viem/_esm/clients/createClient.js -A 5 -B 5

# Search for `transport` in the second file
rg --type js 'transport' experimental/viem-effect/src-viem/_cjs/clients/createClient.js -A 5 -B 5

Length of output: 1152


Script:

#!/bin/bash
# Search for the definition of `transport` across the entire codebase.

# Search for the definition of the transport function or variable
rg --type js 'transport' -A 5 -B 5

Length of output: 249915

bundler-packages/whatsabi/src/knownChains.js (3)

6-202: LGTM! The knownChains object is well-structured.

The mappings of chain IDs to chain configurations are accurate and follow a consistent pattern.


3-5: LGTM! The type annotation is accurate and helpful.

The JSDoc comment provides a clear type annotation for the knownChains object.


1-1: Verify the necessity of importing all chains.

Importing all chains might lead to unused imports. Ensure that all imported chains are utilized in the knownChains object.

Verification successful

Let's re-run the script without specifying the file type to ensure we capture all usages of the chains import.


The import of all chains is necessary and utilized.

The chains import is extensively used in the bundler-packages/whatsabi/src/knownChains.js file, confirming that it is necessary and not leading to unused imports.

  • bundler-packages/whatsabi/src/knownChains.js: Multiple instances of chains usage found.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of all imported chains.

# Test: Search for the usage of each imported chain. Expect: All imported chains are utilized.
rg --type javascript -A 5 $'chains\.\w+'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify the usage of all imported chains.

# Test: Search for the usage of each imported chain. Expect: All imported chains are utilized.
rg -A 5 'chains\.\w+'

Length of output: 45140

bundler-packages/whatsabi/src/KnownChainsType.ts (3)

1-2: LGTM! The imports are necessary and correctly used.

The imports from 'viem/chains' are necessary for defining the known chains and their types.


4-5: LGTM! The type definition is accurate.

The KnownChainsType provides a clear and accurate type for the known chains.


7-203: LGTM! The knownChains object is well-structured.

The mappings of chain IDs to chain configurations are accurate and follow a consistent pattern.

return undefined
}

const chainId = parseInt(match.groups?.['chainId'] ?? '1')
Copy link
Contributor

Choose a reason for hiding this comment

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

Use Number.parseInt instead of parseInt.

Using Number.parseInt is recommended for consistency with ES2015 standards.

- const chainId = parseInt(match.groups?.['chainId'] ?? '1')
+ const chainId = Number.parseInt(match.groups?.['chainId'] ?? '1')
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 = parseInt(match.groups?.['chainId'] ?? '1')
const chainId = Number.parseInt(match.groups?.['chainId'] ?? '1')
Tools
Biome

[error] 14-14: Use Number.parseInt instead of the equivalent global.

ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.

(lint/style/useNumberNamespace)


export type KnownChainsType = typeof knownChains

// TODO this is just lazily copying this twice we could do this cleaner
Copy link
Contributor

Choose a reason for hiding this comment

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

Address the TODO comment.

The TODO comment indicates that the structure can be improved. Consider refactoring to avoid redundancy.

- // TODO this is just lazily copying this twice we could do this cleaner
+ // TODO: Refactor to avoid redundancy in defining known chains.
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
// TODO this is just lazily copying this twice we could do this cleaner
// TODO: Refactor to avoid redundancy in defining known chains.

Comment on lines +20 to +27
return {
chainId: /** @type {import('./KnownChainIds.js').KnownChainIds}*/ (chainId),
address: address,
rpcUrl: params.get('rpcUrl') || undefined,
etherscanApiKey: params.get('etherscanApiKey') || undefined,
etherscanBaseUrl: params.get('etherscanBaseUrl') || undefined,
followProxies: params.get('followProxies') === 'true' || undefined,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding a type guard for chainId.

Adding a type guard for chainId ensures it matches known chain IDs.

const chainId = /** @type {import('./KnownChainIds.js').KnownChainIds}*/ (chainId)
if (!Object.values(import('./KnownChainIds.js').KnownChainIds).includes(chainId)) {
  return undefined
}

Committable suggestion was skipped due to low confidence.

}
}

// TODO pass in tevm config too
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder: Add configuration for tevm.

The TODO comment indicates that configuration for tevm is missing.

Do you want me to generate the configuration code or open a GitHub issue to track this task?

Comment on lines 30 to 34
export const resolveWithWhatsabi = async (contractUri) => {
const parsedUri = parseUri(contractUri)
if (!parsedUri) {
return undefined
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Handle undefined parsedUri appropriately.

Ensure the function handles cases where parsedUri is undefined.

- if (!parsedUri) {
-   return undefined
- }
+ if (!parsedUri) {
+   throw new Error('Invalid contract URI')
+ }
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
export const resolveWithWhatsabi = async (contractUri) => {
const parsedUri = parseUri(contractUri)
if (!parsedUri) {
return undefined
}
export const resolveWithWhatsabi = async (contractUri) => {
const parsedUri = parseUri(contractUri)
if (!parsedUri) {
throw new Error('Invalid contract URI')
}

Comment on lines 65 to 70
return {
abi: /** @type {any}*/ (whatsabiResult.abi),
address: whatsabiResult.address,
deployedBytecode,
// TODO if we can get a verified contract we should compile it with solc and return solc output too
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding additional context to the returned object.

Adding more context to the returned object can be useful for debugging and further processing.

return {
  abi: /** @type {any}*/ (whatsabiResult.abi),
  address: whatsabiResult.address,
  deployedBytecode,
+  chainId: parsedUri.chainId,
+  rpcUrl: parsedUri.rpcUrl,
}
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
return {
abi: /** @type {any}*/ (whatsabiResult.abi),
address: whatsabiResult.address,
deployedBytecode,
// TODO if we can get a verified contract we should compile it with solc and return solc output too
}
return {
abi: /** @type {any}*/ (whatsabiResult.abi),
address: whatsabiResult.address,
deployedBytecode,
// TODO if we can get a verified contract we should compile it with solc and return solc output too
chainId: parsedUri.chainId,
rpcUrl: parsedUri.rpcUrl,
}

Comment on lines 61 to 64
const deployedBytecode = await getCode(client, { address: whatsabiResult.address })
if (!deployedBytecode) {
throw new Error('Could not fetch deployed bytecode')
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Handle cases where deployedBytecode is empty.

Ensure the function handles cases where deployedBytecode is empty.

- if (!deployedBytecode) {
-   throw new Error('Could not fetch deployed bytecode')
- }
+ if (!deployedBytecode || deployedBytecode.length === 0) {
+   throw new Error('Could not fetch deployed bytecode')
+ }
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 deployedBytecode = await getCode(client, { address: whatsabiResult.address })
if (!deployedBytecode) {
throw new Error('Could not fetch deployed bytecode')
}
const deployedBytecode = await getCode(client, { address: whatsabiResult.address })
if (!deployedBytecode || deployedBytecode.length === 0) {
throw new Error('Could not fetch deployed bytecode')
}

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 297fbeb and 4dcb793.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (5)
  • bundler-packages/whatsabi/package.json (1 hunks)
  • bundler-packages/whatsabi/src/contractUriPattern.js (1 hunks)
  • bundler-packages/whatsabi/src/index.ts (1 hunks)
  • bundler-packages/whatsabi/src/loadAbi.js (1 hunks)
  • bundler-packages/whatsabi/src/resolveContractUri.js (1 hunks)
Files skipped from review due to trivial changes (1)
  • bundler-packages/whatsabi/package.json
Files skipped from review as they are similar to previous changes (2)
  • bundler-packages/whatsabi/src/contractUriPattern.js
  • bundler-packages/whatsabi/src/index.ts
Additional comments not posted (7)
bundler-packages/whatsabi/src/loadAbi.js (3)

1-1: Imports look good.

The import statements are correct and necessary for the functionality of the file.


3-11: JSDoc comment looks good.

The JSDoc comment is well-written and provides necessary information for understanding the function's usage.


12-29: Function implementation looks good.

The loadAbi function is well-structured and uses appropriate loaders based on the provided options. It handles optional parameters correctly and ensures type safety.

bundler-packages/whatsabi/src/resolveContractUri.js (4)

1-5: Imports look good.

The import statements are correct and necessary for the functionality of the file.


7-24: Custom error class looks good.

The UnknownChainError class is well-defined and provides useful information when an unknown chain ID is encountered.


28-33: JSDoc comment looks good.

The JSDoc comment is well-written and provides necessary information for understanding the function's usage.


34-69: Function implementation looks good.

The resolveContractUri function is well-structured and handles various scenarios, including unknown chain IDs and missing RPC URLs. It uses appropriate utilities and loaders to resolve the contract URI and fetch the deployed bytecode.

}
}

// TODO pass in tevm config too
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder: Address the TODO comment.

The TODO comment indicates that the tevm config should be passed in.

Do you want me to help address this TODO or open a GitHub issue to track this task?

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

Outside diff range, codebase verification and nitpick comments (1)
docs/src/content/docs/reference/@tevm/base-client/type-aliases/BaseClientOptions.md (1)

The forkTransport property is still present in the codebase.

The forkTransport section has been removed from the documentation, but it is still referenced in multiple files throughout the codebase. Please ensure the documentation is consistent with the current implementation.

  • packages/procedures/src/eth/ethGetTransactionByHashProcedure.js
  • packages/procedures/src/eth/ethGetBlockByNumberProcedure.js
  • packages/procedures/src/eth/gasPriceProcedure.js
  • packages/procedures/src/eth/getStorageAtProcedure.spec.ts
  • packages/procedures/src/eth/gasPriceProcedure.spec.ts
  • packages/procedures/src/debug/debugTraceTransactionProcedure.js
  • packages/actions/src/internal/forkAndCacheBlock.js
  • packages/actions/src/eth/ethGetTransactionReceipt.js
  • packages/actions/src/eth/gasPriceHandler.spec.ts
  • packages/actions/src/eth/getBalanceHandler.js
  • packages/actions/src/eth/gasPriceHandler.js
  • packages/actions/src/eth/getCodeHandler.js
  • packages/actions/src/eth/ethGetLogsHandler.js
  • packages/actions/src/internal/forkAndCacheBlock.spec.ts
  • packages/actions/src/Call/cloneVmWithBlock.js
  • packages/actions/src/Call/cloneVmWithBlock.spec.ts
  • packages/base-client/src/createBaseClient.spec.ts
  • packages/base-client/src/createBaseClient.js
  • packages/base-client/src/BaseClient.ts
Analysis chain

Line range hint 1-158:
Verify the removal of the forkTransport section.

The forkTransport section has been removed. Ensure that this change aligns with the overall documentation and codebase updates.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the removal of the `forkTransport` property in the codebase.

# Test: Search for the `forkTransport` property in the codebase. Expect: No occurrences.
rg --type ts --type tsx --type js --type jsx --type json 'forkTransport'

Length of output: 100


Script:

#!/bin/bash
# Description: Verify the removal of the `forkTransport` property in the codebase.

# Test: Search for the `forkTransport` property in the codebase. Expect: No occurrences.
rg --type ts --type js --type json 'forkTransport'

Length of output: 4178

Tools
LanguageTool

[grammar] ~25-~25: Did you mean to write the noun ‘use’ here?
Context: ...onal**common**:TCommon` The common used of the blockchain. Defaults to tevmDevn...

(USED_OF)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4dcb793 and 9738fb6.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (5)
  • bundler-packages/whatsabi/src/KnownChainsType.ts (1 hunks)
  • bundler-packages/whatsabi/src/parseUri.js (1 hunks)
  • bundler-packages/whatsabi/src/resolveContractUri.js (1 hunks)
  • bundler-packages/whatsabi/src/whatsAbiTevmAdapter.js (1 hunks)
  • docs/src/content/docs/reference/@tevm/base-client/type-aliases/BaseClientOptions.md (3 hunks)
Files skipped from review as they are similar to previous changes (4)
  • bundler-packages/whatsabi/src/KnownChainsType.ts
  • bundler-packages/whatsabi/src/parseUri.js
  • bundler-packages/whatsabi/src/resolveContractUri.js
  • bundler-packages/whatsabi/src/whatsAbiTevmAdapter.js
Additional context used
LanguageTool
docs/src/content/docs/reference/@tevm/base-client/type-aliases/BaseClientOptions.md

[grammar] ~25-~25: Did you mean to write the noun ‘use’ here?
Context: ...onal**common**:TCommon` The common used of the blockchain. Defaults to tevmDevn...

(USED_OF)

@@ -22,8 +22,7 @@ If set to true you may still run up against block limits

> `readonly` `optional` **common**: `TCommon`

The common used of the blockchain. Defaults to tevmDevnet. Required for some APIs such as `getEnsAddress` to work.
If not specified and a fork is provided the common chainId will be fetched from the fork
The common used of the blockchain. Defaults to tevmDevnet. Required for some APIs such as `getEnsAddress` to work. If not specified and a fork is provided the common chainId will be fetched from the fork
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix grammatical error in the common property description.

The phrase "The common used of the blockchain" should be corrected to "The common use of the blockchain."

- The common used of the blockchain. Defaults to tevmDevnet. Required for some APIs such as `getEnsAddress` to work. If not specified and a fork is provided the common chainId will be fetched from the fork
+ The common use of the blockchain. Defaults to tevmDevnet. Required for some APIs such as `getEnsAddress` to work. If not specified and a fork is provided, the common chainId will be fetched from the fork.
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
The common used of the blockchain. Defaults to tevmDevnet. Required for some APIs such as `getEnsAddress` to work. If not specified and a fork is provided the common chainId will be fetched from the fork
The common use of the blockchain. Defaults to tevmDevnet. Required for some APIs such as `getEnsAddress` to work. If not specified and a fork is provided, the common chainId will be fetched from the fork.
Tools
LanguageTool

[grammar] ~25-~25: Did you mean to write the noun ‘use’ here?
Context: ...onal**common**:TCommon` The common used of the blockchain. Defaults to tevmDevn...

(USED_OF)

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9738fb6 and 526666d.

Files selected for processing (4)
  • bundler-packages/whatsabi/package.json (1 hunks)
  • bundler-packages/whatsabi/src/ContractUri.ts (1 hunks)
  • bundler-packages/whatsabi/src/resolveContractUri.js (1 hunks)
  • bundler-packages/whatsabi/src/whatsAbiTevmAdapter.js (1 hunks)
Files skipped from review due to trivial changes (1)
  • bundler-packages/whatsabi/src/ContractUri.ts
Files skipped from review as they are similar to previous changes (2)
  • bundler-packages/whatsabi/src/resolveContractUri.js
  • bundler-packages/whatsabi/src/whatsAbiTevmAdapter.js
Additional comments not posted (9)
bundler-packages/whatsabi/package.json (9)

2-5: Package metadata looks good.

The name, version, privacy, and description fields are correctly populated.


6-12: Keywords are well-chosen.

The keywords accurately reflect the package's domain and usage.


13-21: Repository and contributor information is accurate.

The repository URL, directory, license, and contributor details are correctly specified.


22-38: Module type and exports configuration is correct.

The type is set to module, and the exports, main, module, and types fields are correctly configured for both ESM and CJS.


39-43: Files configuration is correct.

The files field correctly includes the dist, types, and src directories.


62-68: Dependencies are correctly specified.

The runtime dependencies are appropriate and correctly specified.


69-71: DevDependencies are correctly specified.

The development dependencies are appropriate and correctly specified.


73-75: Publish configuration is correct.

The publishConfig field correctly specifies the access level for publishing the package.


76-76: Side effect configuration is correct.

The sideEffect field is correctly set to false, indicating that the package has no side effects.

Comment on lines 44 to 61
"scripts": {
"all": "pnpm i && bun run build && bun run lint && bun run lint:check && bun run format:check && bun run format && bun run test:coverage && bun run generate:docs",
"build": "nx run-many --targets=build:dist,build:types --projects=@tevm/whatsabi ",
"build:dist": "tsup",
"build:types": "tsup --dts-only && tsc --emitDeclarationOnly --declaration",
"clean": "rm -rf node_modules && rm -rf artifacts && rm -rf dist && rm -rf cache",
"format": "biome format . --write",
"format:check": "biome format .",
"generate:docs": "typedoc",
"lint": "biome check . --write --unsafe",
"lint:check": "biome check . --verbose",
"lint:deps": "bunx depcheck",
"lint:package": "bunx publint --strict && attw --pack",
"test": "vitest --coverage",
"test:coverage": "vitest run --coverage",
"test:run": "vitest run",
"test:ui": "vitest --ui"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Scripts section is comprehensive but could be simplified.

The scripts cover all necessary tasks but some scripts could be simplified for better readability and maintainability.

Consider breaking down complex scripts into smaller, more manageable scripts. For example, the all script could be broken down into individual steps:

- "all": "pnpm i  && bun run build && bun run lint && bun run lint:check && bun run format:check && bun run format && bun run test:coverage && bun run generate:docs",
+ "all": "pnpm i && bun run build:all && bun run lint:all && bun run format:all && bun run test:all && bun run generate:docs",
+ "build:all": "bun run build && bun run build:dist && bun run build:types",
+ "lint:all": "bun run lint && bun run lint:check && bun run lint:deps && bun run lint:package",
+ "format:all": "bun run format && bun run format:check",
+ "test:all": "bun run test && bun run test:coverage && bun run test:run && bun run test:ui",
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
"scripts": {
"all": "pnpm i && bun run build && bun run lint && bun run lint:check && bun run format:check && bun run format && bun run test:coverage && bun run generate:docs",
"build": "nx run-many --targets=build:dist,build:types --projects=@tevm/whatsabi ",
"build:dist": "tsup",
"build:types": "tsup --dts-only && tsc --emitDeclarationOnly --declaration",
"clean": "rm -rf node_modules && rm -rf artifacts && rm -rf dist && rm -rf cache",
"format": "biome format . --write",
"format:check": "biome format .",
"generate:docs": "typedoc",
"lint": "biome check . --write --unsafe",
"lint:check": "biome check . --verbose",
"lint:deps": "bunx depcheck",
"lint:package": "bunx publint --strict && attw --pack",
"test": "vitest --coverage",
"test:coverage": "vitest run --coverage",
"test:run": "vitest run",
"test:ui": "vitest --ui"
},
"scripts": {
"all": "pnpm i && bun run build:all && bun run lint:all && bun run format:all && bun run test:all && bun run generate:docs",
"build": "nx run-many --targets=build:dist,build:types --projects=@tevm/whatsabi ",
"build:dist": "tsup",
"build:types": "tsup --dts-only && tsc --emitDeclarationOnly --declaration",
"clean": "rm -rf node_modules && rm -rf artifacts && rm -rf dist && rm -rf cache",
"format": "biome format . --write",
"format:check": "biome format .",
"generate:docs": "typedoc",
"lint": "biome check . --write --unsafe",
"lint:check": "biome check . --verbose",
"lint:deps": "bunx depcheck",
"lint:package": "bunx publint --strict && attw --pack",
"test": "vitest --coverage",
"test:coverage": "vitest run --coverage",
"test:run": "vitest run",
"test:ui": "vitest --ui",
"build:all": "bun run build && bun run build:dist && bun run build:types",
"lint:all": "bun run lint && bun run lint:check && bun run lint:deps && bun run lint:package",
"format:all": "bun run format && bun run format:check",
"test:all": "bun run test && bun run test:coverage && bun run test:run && bun run test:ui"
},

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 526666d and ca94c33.

Files selected for processing (1)
  • bundler-packages/whatsabi/package.json (1 hunks)
Additional comments not posted (6)
bundler-packages/whatsabi/package.json (6)

23-38: Exports and entry points are correctly configured.

The exports and entry points for ESM and CJS are set up correctly.


39-43: Files section is correctly configured.

The files section lists the necessary directories for inclusion in the package.


44-60: Scripts section is comprehensive but could be simplified.

The scripts cover all necessary tasks but some scripts could be simplified for better readability and maintainability.

Consider breaking down complex scripts into smaller, more manageable scripts. For example, the all script could be broken down into individual steps:

- "all": "pnpm i  && bun run build && bun run lint && bun run lint:check && bun run format:check && bun run format && bun run test:coverage && bun run generate:docs",
+ "all": "pnpm i && bun run build:all && bun run lint:all && bun run format:all && bun run test:all && bun run generate:docs",
+ "build:all": "bun run build && bun run build:dist && bun run build:types",
+ "lint:all": "bun run lint && bun run lint:check && bun run lint:deps && bun run lint:package",
+ "format:all": "bun run format && bun run format:check",
+ "test:all": "bun run test && bun run test:coverage && bun run test:run && bun run test:ui",

62-72: Dependencies and devDependencies are correctly listed.

The dependencies are correctly specified, using the workspace protocol for internal packages.


73-76: PublishConfig and sideEffect are correctly configured.

The settings are appropriate for public distribution and indicate no side effects.


2-22: Verify repository URL and directory.

Ensure that the repository URL and directory are correct and accessible.

Verification successful

Repository URL and directory are correct.

Both the repository URL and directory in the package.json are valid and accessible. No issues found.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correctness of the repository URL and directory.

# Test: Check if the repository URL is valid and the directory exists.
git ls-remote https://github.com/evmts/tevm-monorepo.git &> /dev/null && echo "Repository URL is valid" || echo "Repository URL is invalid"
fd --type d 'bundler-packages/whatsabi' && echo "Directory exists" || echo "Directory does not exist"

Length of output: 620


Script:

#!/bin/bash
# Description: Verify the existence of the directory using the correct fd command.

# Corrected Test: Check if the directory exists using --full-path.
fd --full-path 'bundler-packages/whatsabi' && echo "Directory exists" || echo "Directory does not exist"

Length of output: 960

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ca94c33 and 434f872.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (1)
  • bundler-packages/whatsabi/package.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • bundler-packages/whatsabi/package.json

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 434f872 and f17f8b0.

Files selected for processing (107)
  • bundler-packages/whatsabi/package.json (1 hunks)
  • packages/actions/src/eth/gasPriceHandler.spec.ts (1 hunks)
  • packages/errors/docs/classes/AccountLockedError.md (1 hunks)
  • packages/errors/docs/classes/AccountNotFoundError.md (1 hunks)
  • packages/errors/docs/classes/AuthCallNonZeroValueExtError.md (1 hunks)
  • packages/errors/docs/classes/AuthCallUnsetError.md (1 hunks)
  • packages/errors/docs/classes/AuthInvalidSError.md (1 hunks)
  • packages/errors/docs/classes/BLS12381FpNotInFieldError.md (1 hunks)
  • packages/errors/docs/classes/BLS12381InputEmptyError.md (1 hunks)
  • packages/errors/docs/classes/BLS12381InvalidInputLengthError.md (1 hunks)
  • packages/errors/docs/classes/BLS12381PointNotOnCurveError.md (1 hunks)
  • packages/errors/docs/classes/BaseError.md (1 hunks)
  • packages/errors/docs/classes/BlockGasLimitExceededError.md (1 hunks)
  • packages/errors/docs/classes/ChainIdMismatchError.md (1 hunks)
  • packages/errors/docs/classes/CodeSizeExceedsMaximumError.md (1 hunks)
  • packages/errors/docs/classes/CodeStoreOutOfGasError.md (1 hunks)
  • packages/errors/docs/classes/CommonMismatchError.md (1 hunks)
  • packages/errors/docs/classes/ContractExecutionFailedError.md (1 hunks)
  • packages/errors/docs/classes/CreateCollisionError.md (1 hunks)
  • packages/errors/docs/classes/DecodeFunctionDataError.md (1 hunks)
  • packages/errors/docs/classes/DefensiveNullCheckError.md (1 hunks)
  • packages/errors/docs/classes/EipNotEnabledError.md (1 hunks)
  • packages/errors/docs/classes/EncodeFunctionReturnDataError.md (1 hunks)
  • packages/errors/docs/classes/EvmRevertError.md (1 hunks)
  • packages/errors/docs/classes/ExecutionError.md (1 hunks)
  • packages/errors/docs/classes/ForkError.md (1 hunks)
  • packages/errors/docs/classes/GasLimitExceededError.md (1 hunks)
  • packages/errors/docs/classes/InitcodeSizeViolationError.md (1 hunks)
  • packages/errors/docs/classes/InsufficientBalanceError.md (1 hunks)
  • packages/errors/docs/classes/InsufficientFundsError.md (1 hunks)
  • packages/errors/docs/classes/InsufficientPermissionsError.md (1 hunks)
  • packages/errors/docs/classes/InternalError.md (1 hunks)
  • packages/errors/docs/classes/InternalEvmError.md (1 hunks)
  • packages/errors/docs/classes/InternalRpcError.md (1 hunks)
  • packages/errors/docs/classes/InvalidAbiError.md (1 hunks)
  • packages/errors/docs/classes/InvalidAddressError.md (1 hunks)
  • packages/errors/docs/classes/InvalidArgsError.md (1 hunks)
  • packages/errors/docs/classes/InvalidBalanceError.md (1 hunks)
  • packages/errors/docs/classes/InvalidBeginSubError.md (1 hunks)
  • packages/errors/docs/classes/InvalidBlobVersionedHashesError.md (1 hunks)
  • packages/errors/docs/classes/InvalidBlockError.md (1 hunks)
  • packages/errors/docs/classes/InvalidBytecodeError.md (1 hunks)
  • packages/errors/docs/classes/InvalidBytecodeResultError.md (1 hunks)
  • packages/errors/docs/classes/InvalidBytesSizeError.md (1 hunks)
  • packages/errors/docs/classes/InvalidCallerError.md (1 hunks)
  • packages/errors/docs/classes/InvalidCommitmentError.md (1 hunks)
  • packages/errors/docs/classes/InvalidDataError.md (1 hunks)
  • packages/errors/docs/classes/InvalidDeployedBytecodeError.md (1 hunks)
  • packages/errors/docs/classes/InvalidDepthError.md (1 hunks)
  • packages/errors/docs/classes/InvalidEofFormatError.md (1 hunks)
  • packages/errors/docs/classes/InvalidFunctionNameError.md (1 hunks)
  • packages/errors/docs/classes/InvalidGasLimitError.md (1 hunks)
  • packages/errors/docs/classes/InvalidGasPriceError.md (1 hunks)
  • packages/errors/docs/classes/InvalidGasRefundError.md (1 hunks)
  • packages/errors/docs/classes/InvalidInputLengthError.md (1 hunks)
  • packages/errors/docs/classes/InvalidInputRpcError.md (1 hunks)
  • packages/errors/docs/classes/InvalidJumpError.md (1 hunks)
  • packages/errors/docs/classes/InvalidJumpSubError.md (1 hunks)
  • packages/errors/docs/classes/InvalidKzgInputsError.md (1 hunks)
  • packages/errors/docs/classes/InvalidMaxFeePerGasError.md (1 hunks)
  • packages/errors/docs/classes/InvalidMaxPriorityFeePerGasError.md (1 hunks)
  • packages/errors/docs/classes/InvalidNonceError.md (1 hunks)
  • packages/errors/docs/classes/InvalidOpcodeError.md (1 hunks)
  • packages/errors/docs/classes/InvalidOriginError.md (1 hunks)
  • packages/errors/docs/classes/InvalidParamsError.md (1 hunks)
  • packages/errors/docs/classes/InvalidParamsRpcError.md (1 hunks)
  • packages/errors/docs/classes/InvalidProofError.md (1 hunks)
  • packages/errors/docs/classes/InvalidRequestError.md (1 hunks)
  • packages/errors/docs/classes/InvalidRequestRpcError.md (1 hunks)
  • packages/errors/docs/classes/InvalidReturnSubError.md (1 hunks)
  • packages/errors/docs/classes/InvalidSaltError.md (1 hunks)
  • packages/errors/docs/classes/InvalidSelfdestructError.md (1 hunks)
  • packages/errors/docs/classes/InvalidSignatureError.md (1 hunks)
  • packages/errors/docs/classes/InvalidSkipBalanceError.md (1 hunks)
  • packages/errors/docs/classes/InvalidStorageRootError.md (1 hunks)
  • packages/errors/docs/classes/InvalidToError.md (1 hunks)
  • packages/errors/docs/classes/InvalidTransactionError.md (1 hunks)
  • packages/errors/docs/classes/InvalidUrlError.md (1 hunks)
  • packages/errors/docs/classes/InvalidValueError.md (1 hunks)
  • packages/errors/docs/classes/JsonRpcVersionUnsupportedError.md (1 hunks)
  • packages/errors/docs/classes/LimitExceededError.md (1 hunks)
  • packages/errors/docs/classes/LimitExceededRpcError.md (1 hunks)
  • packages/errors/docs/classes/MethodNotFoundError.md (1 hunks)
  • packages/errors/docs/classes/MethodNotFoundRpcError.md (1 hunks)
  • packages/errors/docs/classes/MethodNotSupportedError.md (1 hunks)
  • packages/errors/docs/classes/MethodNotSupportedRpcError.md (1 hunks)
  • packages/errors/docs/classes/MisconfiguredClientError.md (1 hunks)
  • packages/errors/docs/classes/NoForkTransportSetError.md (1 hunks)
  • packages/errors/docs/classes/NonceAlreadyUsedError.md (1 hunks)
  • packages/errors/docs/classes/NonceTooHighError.md (1 hunks)
  • packages/errors/docs/classes/NonceTooLowError.md (1 hunks)
  • packages/errors/docs/classes/OutOfGasError.md (1 hunks)
  • packages/errors/docs/classes/OutOfRangeError.md (1 hunks)
  • packages/errors/docs/classes/ParseError.md (1 hunks)
  • packages/errors/docs/classes/ParseRpcError.md (1 hunks)
  • packages/errors/docs/classes/PendingTransactionTimeoutError.md (1 hunks)
  • packages/errors/docs/classes/ProviderDisconnectedError.md (1 hunks)
  • packages/errors/docs/classes/RateLimitExceededError.md (1 hunks)
  • packages/errors/docs/classes/RefundExhaustedError.md (1 hunks)
  • packages/errors/docs/classes/ResourceNotFoundError.md (1 hunks)
  • packages/errors/docs/classes/ResourceNotFoundRpcError.md (1 hunks)
  • packages/errors/docs/classes/ResourceUnavailableError.md (1 hunks)
  • packages/errors/docs/classes/ResourceUnavailableRpcError.md (1 hunks)
  • packages/errors/docs/classes/RevertError.md (1 hunks)
  • packages/errors/docs/classes/StackOverflowError.md (1 hunks)
  • packages/errors/docs/classes/StackUnderflowError.md (1 hunks)
  • packages/errors/docs/classes/StaticStateChangeError.md (1 hunks)
Files not processed due to max files limit (13)
  • packages/errors/docs/classes/StopError.md
  • packages/errors/docs/classes/TimeoutError.md
  • packages/errors/docs/classes/TransactionRejectedError.md
  • packages/errors/docs/classes/TransactionTooLargeError.md
  • packages/errors/docs/classes/TransactionUnderpricedError.md
  • packages/errors/docs/classes/UnknownBlockError.md
  • packages/errors/docs/classes/UnknownRpcError.md
  • packages/errors/docs/classes/UnreachableCodeError.md
  • packages/errors/docs/classes/UnsupportedChainError.md
  • packages/errors/docs/classes/UnsupportedProviderMethodError.md
  • packages/errors/docs/classes/UserRejectedRequestError.md
  • packages/errors/docs/classes/ValueOverflowError.md
  • packages/utils/docs/classes/AsyncEventEmitter.md
Files skipped from review due to trivial changes (105)
  • packages/errors/docs/classes/AccountLockedError.md
  • packages/errors/docs/classes/AccountNotFoundError.md
  • packages/errors/docs/classes/AuthCallNonZeroValueExtError.md
  • packages/errors/docs/classes/AuthCallUnsetError.md
  • packages/errors/docs/classes/AuthInvalidSError.md
  • packages/errors/docs/classes/BLS12381FpNotInFieldError.md
  • packages/errors/docs/classes/BLS12381InputEmptyError.md
  • packages/errors/docs/classes/BLS12381InvalidInputLengthError.md
  • packages/errors/docs/classes/BLS12381PointNotOnCurveError.md
  • packages/errors/docs/classes/BaseError.md
  • packages/errors/docs/classes/BlockGasLimitExceededError.md
  • packages/errors/docs/classes/ChainIdMismatchError.md
  • packages/errors/docs/classes/CodeSizeExceedsMaximumError.md
  • packages/errors/docs/classes/CodeStoreOutOfGasError.md
  • packages/errors/docs/classes/CommonMismatchError.md
  • packages/errors/docs/classes/ContractExecutionFailedError.md
  • packages/errors/docs/classes/CreateCollisionError.md
  • packages/errors/docs/classes/DecodeFunctionDataError.md
  • packages/errors/docs/classes/DefensiveNullCheckError.md
  • packages/errors/docs/classes/EipNotEnabledError.md
  • packages/errors/docs/classes/EncodeFunctionReturnDataError.md
  • packages/errors/docs/classes/EvmRevertError.md
  • packages/errors/docs/classes/ExecutionError.md
  • packages/errors/docs/classes/ForkError.md
  • packages/errors/docs/classes/GasLimitExceededError.md
  • packages/errors/docs/classes/InitcodeSizeViolationError.md
  • packages/errors/docs/classes/InsufficientBalanceError.md
  • packages/errors/docs/classes/InsufficientFundsError.md
  • packages/errors/docs/classes/InsufficientPermissionsError.md
  • packages/errors/docs/classes/InternalError.md
  • packages/errors/docs/classes/InternalEvmError.md
  • packages/errors/docs/classes/InternalRpcError.md
  • packages/errors/docs/classes/InvalidAbiError.md
  • packages/errors/docs/classes/InvalidAddressError.md
  • packages/errors/docs/classes/InvalidArgsError.md
  • packages/errors/docs/classes/InvalidBalanceError.md
  • packages/errors/docs/classes/InvalidBeginSubError.md
  • packages/errors/docs/classes/InvalidBlobVersionedHashesError.md
  • packages/errors/docs/classes/InvalidBlockError.md
  • packages/errors/docs/classes/InvalidBytecodeError.md
  • packages/errors/docs/classes/InvalidBytecodeResultError.md
  • packages/errors/docs/classes/InvalidBytesSizeError.md
  • packages/errors/docs/classes/InvalidCallerError.md
  • packages/errors/docs/classes/InvalidCommitmentError.md
  • packages/errors/docs/classes/InvalidDataError.md
  • packages/errors/docs/classes/InvalidDeployedBytecodeError.md
  • packages/errors/docs/classes/InvalidDepthError.md
  • packages/errors/docs/classes/InvalidEofFormatError.md
  • packages/errors/docs/classes/InvalidFunctionNameError.md
  • packages/errors/docs/classes/InvalidGasLimitError.md
  • packages/errors/docs/classes/InvalidGasPriceError.md
  • packages/errors/docs/classes/InvalidGasRefundError.md
  • packages/errors/docs/classes/InvalidInputLengthError.md
  • packages/errors/docs/classes/InvalidInputRpcError.md
  • packages/errors/docs/classes/InvalidJumpError.md
  • packages/errors/docs/classes/InvalidJumpSubError.md
  • packages/errors/docs/classes/InvalidKzgInputsError.md
  • packages/errors/docs/classes/InvalidMaxFeePerGasError.md
  • packages/errors/docs/classes/InvalidMaxPriorityFeePerGasError.md
  • packages/errors/docs/classes/InvalidNonceError.md
  • packages/errors/docs/classes/InvalidOpcodeError.md
  • packages/errors/docs/classes/InvalidOriginError.md
  • packages/errors/docs/classes/InvalidParamsError.md
  • packages/errors/docs/classes/InvalidParamsRpcError.md
  • packages/errors/docs/classes/InvalidProofError.md
  • packages/errors/docs/classes/InvalidRequestError.md
  • packages/errors/docs/classes/InvalidRequestRpcError.md
  • packages/errors/docs/classes/InvalidReturnSubError.md
  • packages/errors/docs/classes/InvalidSaltError.md
  • packages/errors/docs/classes/InvalidSelfdestructError.md
  • packages/errors/docs/classes/InvalidSignatureError.md
  • packages/errors/docs/classes/InvalidSkipBalanceError.md
  • packages/errors/docs/classes/InvalidStorageRootError.md
  • packages/errors/docs/classes/InvalidToError.md
  • packages/errors/docs/classes/InvalidTransactionError.md
  • packages/errors/docs/classes/InvalidUrlError.md
  • packages/errors/docs/classes/InvalidValueError.md
  • packages/errors/docs/classes/JsonRpcVersionUnsupportedError.md
  • packages/errors/docs/classes/LimitExceededError.md
  • packages/errors/docs/classes/LimitExceededRpcError.md
  • packages/errors/docs/classes/MethodNotFoundError.md
  • packages/errors/docs/classes/MethodNotFoundRpcError.md
  • packages/errors/docs/classes/MethodNotSupportedError.md
  • packages/errors/docs/classes/MethodNotSupportedRpcError.md
  • packages/errors/docs/classes/MisconfiguredClientError.md
  • packages/errors/docs/classes/NoForkTransportSetError.md
  • packages/errors/docs/classes/NonceAlreadyUsedError.md
  • packages/errors/docs/classes/NonceTooHighError.md
  • packages/errors/docs/classes/NonceTooLowError.md
  • packages/errors/docs/classes/OutOfGasError.md
  • packages/errors/docs/classes/OutOfRangeError.md
  • packages/errors/docs/classes/ParseError.md
  • packages/errors/docs/classes/ParseRpcError.md
  • packages/errors/docs/classes/PendingTransactionTimeoutError.md
  • packages/errors/docs/classes/ProviderDisconnectedError.md
  • packages/errors/docs/classes/RateLimitExceededError.md
  • packages/errors/docs/classes/RefundExhaustedError.md
  • packages/errors/docs/classes/ResourceNotFoundError.md
  • packages/errors/docs/classes/ResourceNotFoundRpcError.md
  • packages/errors/docs/classes/ResourceUnavailableError.md
  • packages/errors/docs/classes/ResourceUnavailableRpcError.md
  • packages/errors/docs/classes/RevertError.md
  • packages/errors/docs/classes/StackOverflowError.md
  • packages/errors/docs/classes/StackUnderflowError.md
  • packages/errors/docs/classes/StaticStateChangeError.md
Files skipped from review as they are similar to previous changes (1)
  • bundler-packages/whatsabi/package.json
Additional comments not posted (2)
packages/actions/src/eth/gasPriceHandler.spec.ts (2)

Line range hint 10-19: LGTM!

The test case correctly verifies the default behavior of gasPriceHandler when no forkUrl is provided.


Line range hint 33-37: Verify alignment with updated requirements.

The test now expects a gas price greater than 0.1 Gwei instead of 1 Gwei. Ensure this change aligns with updated business logic or external factors influencing gas price calculations.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f17f8b0 and ecfd7e3.

Files selected for processing (3)
  • bundler-packages/whatsabi/.depcheckrc (1 hunks)
  • bundler-packages/whatsabi/package.json (1 hunks)
  • bundler-packages/whatsabi/src/resolveContractUri.js (1 hunks)
Files skipped from review due to trivial changes (1)
  • bundler-packages/whatsabi/.depcheckrc
Files skipped from review as they are similar to previous changes (1)
  • bundler-packages/whatsabi/package.json
Additional comments not posted (2)
bundler-packages/whatsabi/src/resolveContractUri.js (2)

7-24: LGTM!

The UnknownChainError class is well-implemented and provides a clear error message for unknown chain IDs.


27-27: Reminder: Address the TODO comment.

The TODO comment indicates that the tevm config should be passed in.

Comment on lines 67 to 69
// TODO we want to represent proxies in some way like listing the resolved addy
// ...{resolvedAddress: whatsabiResult.address},
// TODO if we can get a verified contract we should compile it with solc and return solc output too
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder: Address the TODO comments.

The TODO comments suggest representing proxies and compiling verified contracts with solc.

Do you want me to help address these TODOs or open a GitHub issue to track these tasks?

Comment on lines 57 to 62
const deployedBytecode = await getCode(client, {
address: /** @type {import('@tevm/utils').Address}*/ (whatsabiResult.address),
})
if (!deployedBytecode) {
throw new Error('Could not fetch deployed bytecode')
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Enhance error handling for getCode.

The call to getCode should include error handling to manage potential failures in fetching the deployed bytecode.

try {
  const deployedBytecode = await getCode(client, {
    address: /** @type {import('@tevm/utils').Address}*/ (whatsabiResult.address),
  });
  if (!deployedBytecode) {
    throw new Error('Could not fetch deployed bytecode');
  }
} catch (error) {
  throw new Error(`Error fetching deployed bytecode: ${error.message}`);
}

* @throws {UnknownChainError} if the chainId is not known and no rpcUrl is provided
*/
export const resolveContractUri = async (contractUri, config) => {
console.log('todo config', config)
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove console log statement.

The console log statement is likely for debugging purposes and should be removed in production code.

- console.log('todo config', config)
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
console.log('todo config', config)

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ecfd7e3 and 6abdb65.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (1)
  • bundler-packages/whatsabi/src/resolveContractUri.js (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • bundler-packages/whatsabi/src/resolveContractUri.js

@roninjin10 roninjin10 merged commit 94aadff into main Aug 12, 2024
9 checks passed
@roninjin10 roninjin10 deleted the 07-27-_sparkles_feat_whatsabi_imports branch August 12, 2024 00:38
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