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(contract): Add address utility to contract #828

Merged
merged 4 commits into from
Jan 17, 2024

Conversation

roninjin10
Copy link
Collaborator

@roninjin10 roninjin10 commented Jan 17, 2024


"@tevm/contract": major

  • Changed name of TevmContract to Contract
  • Changed name of createTevmContract to createContract
  • Added Script to be a Contract with bytecode
  • Removed bytecode from Contract
  • Added a new withAddress method for adding an address to a contract
  • Removed need to explicitly pass in undefined for optional params

withAddress

Before we had to spred contracts like this:

client.readContract({
  address: contractAddress,
  ...Erc20Contract.read.balanceOf(userAddress)
})

Now Tevm can create a contract with an address attatched

client.readContract(
  Erc20Contract.withAddress(contractAddress).read.balanceOf(userAddress)
)

Summary by CodeRabbit

  • New Features

    • Introduced Script as a new contract type with bytecode.
    • Added a withAddress method to associate an address with a contract.
    • New utility functions for formatting logs and currency values.
  • Enhancements

    • Streamlined contract creation with updated function names.
    • Improved contract and script type definitions for better abstraction.
  • Documentation

    • Updated documentation to reflect changes in contract and script creation.
  • Refactor

    • Renamed TevmContract to Contract across the platform for clarity.
    • Adjusted test files and error messages to align with the latest terminology.
  • Bug Fixes

    • Fixed optional parameter handling, eliminating the need to pass undefined.
  • Chores

    • Removed unused properties from the vitest.config.ts coverage configuration.
  • Tests

    • Enhanced test suites for contract and script creation functions.

Copy link

changeset-bot bot commented Jan 17, 2024

🦋 Changeset detected

Latest commit: 78aaa35

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@tevm/contract Major
@tevm/experimental-solc Major
@tevm/viem Major
@tevm/client Major
@tevm/predeploys Major
@tevm/vm Major
tevm Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

vercel bot commented Jan 17, 2024

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

Name Status Preview Comments Updated (UTC)
evmts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 17, 2024 5:58am

@roninjin10
Copy link
Collaborator Author

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

Copy link
Contributor

coderabbitai bot commented Jan 17, 2024

Walkthrough

The overarching update streamlines the @tevm/contract module, simplifying its interface and enhancing its functionality. Key changes include renaming TevmContract to Contract, introducing Script as a contract type with bytecode, and adding a method to associate contracts with addresses. The update removes bytecode from Contract and obviates the need for undefined in optional parameters. This ripple effect cascades through test files, documentation, and TypeScript definitions, aligning naming conventions and improving type signatures across the codebase.

Changes

Files Summary
.changeset/neat-sloths-film.md Renamed TevmContract to Contract, introduced Script, and updated method for address association.
.../base/TestContract.d.ts, .../bundler-cache/TestContract.d.ts, .../compiler/TestContract.d.ts, .../resolutions/TestContract.d.ts, .../solc/TestContract.d.ts, tevm/contract/index.d.ts Updated type declarations from TevmContract to Contract.
.../base/src/bundler.spec.ts, .../runtime/src/generateRuntime.spec.ts, .../runtime/src/generateTevmBody.spec.ts, .../runtime/src/generateTevmBodyDts.spec.ts, .../contract/src/event/eventFactory.spec.ts, .../contract/src/read/readFactory.spec.ts, .../contract/src/write/writeFactory.spec.ts Renamed module types and function calls; replaced createTevmContract with createContract.
.../bun/docs/modules.md, .../runtime/docs/modules.md, .../contract/docs/modules.md, .../docs/modules/contract.md, .../docs/modules/index.md, .../docs/modules/vm.md, .../predeploys/docs/modules.md, .../vm/docs/modules.md Updated documentation with new naming and type alias conventions.
.../runtime/src/generateRuntime.js, .../runtime/src/generateTevmBody.js, .../runtime/src/generateTevmBodyDts.js, .../contract/src/createContract.js, .../contract/src/createScript.js, .../contract/src/event/eventFactory.js, .../contract/src/read/readFactory.js, .../contract/src/write/writeFactory.js, tevm/contract/index.js, tevm/index.js, .../predeploys/src/definePredeploy.ts Renamed createTevmContract to createContract and updated import logic based on parameters.
.../runtime/vitest.config.ts Modified coverage configuration in vitest.config.ts.
extensions/viem/src/tests/ERC20.sol.ts, vm/client/src/test/Add.s.sol.ts, vm/client/src/test/ERC20.sol.ts Replaced createTevmContract with createScript and set bytecode to '0x0'.
lsp/ts-plugin/src/decorators/getDefinitionAtPosition.spec.ts, lsp/ts-plugin/src/decorators/getDefinitionAtPosition.ts, lsp/ts-plugin/src/decorators/getScriptSnapshot.spec.ts Renamed tevmContractPath to ContractPath and updated error messages and defaults.
packages/contract/src/Contract.ts, packages/contract/src/Script.ts, .../contract/src/createContract.spec.ts, .../contract/src/createScript.spec.ts, .../contract/src/index.js, .../contract/src/index.ts, .../contract/src/types.ts Added TypeScript interface and type definitions for contracts and scripts, and updated exports and tests.
packages/contract/src/event/Event.ts Adjusted Events type to use Address and removed tevmContractName.
packages/contract/src/read/Read.ts, packages/contract/src/write/Write.ts Added Address type and updated function signatures in Read and Write types.
.../predeploys/docs/classes/Predeploy.md, .../predeploys/src/predeploy.spec.ts, .../vm/src/CreateEVMOptions.ts, .../vm/src/test/predeploy.spec.ts Replaced TevmContract with Script and updated function signatures.

🐇✨
CodeRabbit hopped through the fields of code,
Refactoring contracts with a lighter load.
With a twitch of the nose and a flick of the ear,
Celebrate the changes, for clean code is here! 🎉
🐇✨

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@roninjin10 roninjin10 merged commit 3b5f672 into main Jan 17, 2024
36 checks passed
@roninjin10 roninjin10 deleted the 01-16-feat_contract_Add_address_utility_to_contract branch January 17, 2024 06:00
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.

Review Status

Actionable comments generated: 4

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 905dfa5 and a51d3b8.
Files ignored due to path filters (1)
  • packages/contract/package.json is excluded by: !**/*.json
Files selected for processing (57)
  • .changeset/neat-sloths-film.md (1 hunks)
  • bundler/base/TestContract.d.ts (2 hunks)
  • bundler/base/src/bundler.spec.ts (8 hunks)
  • bundler/bun/docs/modules.md (2 hunks)
  • bundler/bundler-cache/TestContract.d.ts (2 hunks)
  • bundler/compiler/TestContract.d.ts (2 hunks)
  • bundler/resolutions/TestContract.d.ts (2 hunks)
  • bundler/runtime/docs/modules.md (2 hunks)
  • bundler/runtime/src/generateRuntime.js (2 hunks)
  • bundler/runtime/src/generateRuntime.spec.ts (2 hunks)
  • bundler/runtime/src/generateTevmBody.js (2 hunks)
  • bundler/runtime/src/generateTevmBody.spec.ts (4 hunks)
  • bundler/runtime/src/generateTevmBodyDts.js (2 hunks)
  • bundler/runtime/src/generateTevmBodyDts.spec.ts (1 hunks)
  • bundler/runtime/vitest.config.ts (1 hunks)
  • bundler/solc/TestContract.d.ts (2 hunks)
  • extensions/viem/src/tests/ERC20.sol.ts (2 hunks)
  • lsp/ts-plugin/src/decorators/getDefinitionAtPosition.spec.ts (1 hunks)
  • lsp/ts-plugin/src/decorators/getDefinitionAtPosition.ts (2 hunks)
  • lsp/ts-plugin/src/decorators/getScriptSnapshot.spec.ts (1 hunks)
  • packages/contract/docs/modules.md (3 hunks)
  • packages/contract/src/Contract.ts (1 hunks)
  • packages/contract/src/Script.ts (1 hunks)
  • packages/contract/src/createContract.js (1 hunks)
  • packages/contract/src/createContract.spec.ts (1 hunks)
  • packages/contract/src/createScript.js (1 hunks)
  • packages/contract/src/createScript.spec.ts (1 hunks)
  • packages/contract/src/event/Event.ts (4 hunks)
  • packages/contract/src/event/eventFactory.js (1 hunks)
  • packages/contract/src/event/eventFactory.spec.ts (1 hunks)
  • packages/contract/src/index.js (1 hunks)
  • packages/contract/src/index.ts (1 hunks)
  • packages/contract/src/read/Read.ts (3 hunks)
  • packages/contract/src/read/readFactory.js (1 hunks)
  • packages/contract/src/read/readFactory.spec.ts (1 hunks)
  • packages/contract/src/types.ts (1 hunks)
  • packages/contract/src/write/Write.ts (3 hunks)
  • packages/contract/src/write/writeFactory.js (1 hunks)
  • packages/contract/src/write/writeFactory.spec.ts (1 hunks)
  • tevm/contract/index.d.ts (1 hunks)
  • tevm/contract/index.js (1 hunks)
  • tevm/contract/index.ts (1 hunks)
  • tevm/docs/modules/contract.md (2 hunks)
  • tevm/docs/modules/index.md (5 hunks)
  • tevm/docs/modules/vm.md (1 hunks)
  • tevm/index.d.ts (1 hunks)
  • tevm/index.js (1 hunks)
  • tevm/index.ts (1 hunks)
  • vm/client/src/test/Add.s.sol.ts (2 hunks)
  • vm/client/src/test/ERC20.sol.ts (2 hunks)
  • vm/predeploys/docs/classes/Predeploy.md (5 hunks)
  • vm/predeploys/docs/modules.md (2 hunks)
  • vm/predeploys/src/definePredeploy.ts (2 hunks)
  • vm/predeploys/src/predeploy.spec.ts (1 hunks)
  • vm/vm/docs/modules.md (1 hunks)
  • vm/vm/src/CreateEVMOptions.ts (1 hunks)
  • vm/vm/src/test/predeploy.spec.ts (1 hunks)
Files skipped from review due to trivial changes (5)
  • bundler/bun/docs/modules.md
  • bundler/runtime/docs/modules.md
  • lsp/ts-plugin/src/decorators/getDefinitionAtPosition.spec.ts
  • tevm/docs/modules/contract.md
  • tevm/index.ts
Additional comments: 93
tevm/contract/index.d.ts (1)
  • 2-3: The changes correctly reflect the renaming of TevmContract to Contract and createTevmContract to createContract. This aligns with the PR objectives and the AI-generated summary.
tevm/contract/index.ts (1)
  • 2-9: The changes correctly reflect the renaming of TevmContract to Contract and createTevmContract to createContract. This aligns with the PR objectives and the AI-generated summary.
tevm/contract/index.js (1)
  • 2-2: The changes correctly reflect the renaming of createTevmContract to createContract. This aligns with the PR objectives and the AI-generated summary.
bundler/runtime/vitest.config.ts (1)
  • 7-12: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [5-9]

The simplification of the coverage configuration by removing several properties is a positive change for maintainability, assuming that the removed properties are indeed not required.

tevm/index.js (1)
  • 3-3: The changes correctly reflect the renaming of createTevmContract to createContract. This aligns with the PR objectives and the AI-generated summary.
vm/vm/src/CreateEVMOptions.ts (1)
  • 11-11: The change in CreateEVMOptions to accept only two type parameters for customPredeploys suggests a simplification of the type structure. Ensure that all usages of customPredeploys are updated to reflect this change.
Verification successful

The usage of customPredeploys in predeploy.spec.ts is consistent with the updated CustomPredeploy type structure in CreateEVMOptions.ts, which now accepts only two type parameters. The predeploy variable is correctly defined with the necessary address and contract properties to match the CustomPredeploy type.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that all usages of customPredeploys have been updated.
rg "customPredeploys" --type ts

Length of output: 188



Script:

#!/bin/bash
# Check the definition of the CustomPredeploy type
ast-grep --lang typescript --pattern 'type CustomPredeploy<$_, $_> = $$$'

# Inspect the predeploy variable in predeploy.spec.ts
rg "const predeploy =" vm/vm/src/test/predeploy.spec.ts

Length of output: 632



Script:

#!/bin/bash
# Inspect the parameters passed to definePredeploy in predeploy.spec.ts
rg "definePredeploy\(" vm/vm/src/test/predeploy.spec.ts

Length of output: 94



Script:

#!/bin/bash
# Extract the full definition of the predeploy variable to see the actual arguments passed to definePredeploy
rg -A 10 "const predeploy =" vm/vm/src/test/predeploy.spec.ts

Length of output: 262

packages/contract/src/index.js (1)
  • 1-17: The export changes and additions are consistent with the PR objectives and the AI-generated summary, which includes the introduction of createScript and the reorganization of utility functions.
tevm/index.d.ts (1)
  • 20-21: The changes correctly reflect the renaming of TevmContract to Contract and createTevmContract to createContract. This aligns with the PR objectives and the AI-generated summary.
packages/contract/src/index.ts (1)
  • 1-22: The changes in index.ts correctly introduce new type exports and utility functions, aligning with the PR objectives and the AI-generated summary.
.changeset/neat-sloths-film.md (1)
  • 5-10: The changeset file correctly documents the major changes made to @tevm/contract, including the renaming of TevmContract and createTevmContract, the addition of Script, and the new withAddress method.
packages/contract/src/Script.ts (1)
  • 7-28: The Script type definition is well-structured and includes a withAddress method for associating an address with a script, which is a new feature mentioned in the PR objectives and the AI-generated summary.
vm/predeploys/src/predeploy.spec.ts (1)
  • 12-12: The test file reflects the change from createTevmContract to createScript, which is consistent with the changes described in the PR objectives and the AI-generated summary.
packages/contract/src/Contract.ts (1)
  • 6-27: The Contract type definition correctly omits the bytecode and deployedBytecode properties, aligning with the PR objectives and the AI-generated summary.
packages/contract/src/types.ts (1)
  • 4-39: The CreateContractParams and CreateScriptParams types are correctly defined, and the CreateContract and CreateScript types are consistent with the changes described in the PR objectives and the AI-generated summary.
vm/predeploys/src/definePredeploy.ts (3)
  • 11-11: The CustomPredeploy type now correctly uses Script instead of TevmContract, which is consistent with the changes described in the PR objectives and the AI-generated summary.
  • 18-18: The Predeploy class correctly uses Script instead of TevmContract, aligning with the broader refactoring efforts and the introduction of the new Script type.
  • 33-36: The definePredeploy function has been updated to reflect the removal of TBytecode and TDeployedBytecode from its generic type parameters, which is consistent with the changes described in the PR objectives and the AI-generated summary.
packages/contract/src/event/eventFactory.js (1)
  • 12-41: The eventsFactory function is correctly implemented to create event action creators from parameters. The internal TODO comments suggest areas for future improvement, which is good for maintainability.
vm/vm/src/test/predeploy.spec.ts (1)
  • 12-12: The test file reflects the change from createTevmContract to createScript, which is consistent with the changes described in the PR objectives and the AI-generated summary.
vm/client/src/test/Add.s.sol.ts (1)
  • 33-36: The change from createTevmContract to createScript and the update of the bytecode property from undefined to '0x0' are consistent with the changes described in the PR objectives and the AI-generated summary.
bundler/runtime/src/generateRuntime.js (1)
  • 29-30: The dynamic selection of imports based on moduleType and includeBytecode parameters is a good example of conditional logic to handle different scenarios, which improves the flexibility of import handling.
vm/predeploys/docs/modules.md (2)
  • 23-23: The CustomPredeploy type alias documentation correctly reflects the removal of TBytecode and TDeployedBytecode type parameters, aligning with the changes in the codebase.
  • 47-47: The definePredeploy function documentation has been updated to reflect the changes in the codebase, removing the TBytecode and TDeployedBytecode type parameters.
packages/contract/src/read/Read.ts (1)
  • 27-52: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [16-51]

The Read type has been updated to include TAddress and TAddressArgs, which adds conditional properties based on the length of TArgs. This change is consistent with the PR objectives and the AI-generated summary.

packages/contract/src/write/Write.ts (1)
  • 30-55: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [16-54]

The Write type has been updated to include TAddress and TAddressArgs, which adds conditional properties based on the length of TArgs. This change is consistent with the PR objectives and the AI-generated summary.

packages/contract/src/read/readFactory.js (1)
  • 12-50: The readFactory function is correctly implemented to create read action creators from parameters. The internal TODO comments suggest areas for future improvement, which is good for maintainability.
bundler/runtime/src/generateTevmBodyDts.js (1)
  • 23-35: The generateDtsBody function now conditionally exports a different type of script based on the includeBytecode parameter, which is a good example of conditional logic to handle different scenarios and improves the flexibility of the code.
packages/contract/src/write/writeFactory.js (1)
  • 12-51: The writeFactory function is correctly implemented to create write action creators from parameters. The internal TODO comments suggest areas for future improvement, which is good for maintainability.
packages/contract/src/createContract.js (1)
  • 12-46: The createContract function is correctly implemented to create a contract instance from a human-readable ABI. The withAddress method is a new feature that aligns with the PR objectives and the AI-generated summary.
packages/contract/src/event/eventFactory.spec.ts (1)
  • 7-7: The test file reflects the change from createTevmContract to createContract, which is consistent with the changes described in the PR objectives and the AI-generated summary.
vm/predeploys/docs/classes/Predeploy.md (2)
  • 3-3: The documentation for the Predeploy class correctly reflects the removal of TBytecode and TDeployedBytecode from the type parameters, aligning with the changes in the codebase.
  • 59-59: The contract property type has been updated to Script with only TName and THumanReadableAbi type parameters, which is consistent with the changes in the codebase.
bundler/runtime/src/generateTevmBody.js (2)
  • 21-27: The generateTevmBody function has been modified to conditionally include bytecode generation based on the includeBytecode parameter. This change is consistent with the PR objectives and the AI-generated summary.
  • 44-46: The conditional logic to handle different module types and whether to include bytecode is correctly implemented, improving the flexibility of the code.
packages/contract/src/createScript.js (2)
  • 7-16: The function createScript is well-documented with a JSDoc comment, which is good for maintainability.
  • 39-66: The withAddress method is a good example of a fluent interface, allowing for chaining method calls. However, ensure that the getAddress function has proper error handling for invalid addresses.
Verification successful

The getAddress function in the getAddress.js file checks if the provided address is valid using the isAddress function. If the address is not valid, it throws an InvalidAddressError. This indicates that the getAddress function does indeed have proper error handling for invalid addresses.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify getAddress handles errors gracefully
rg --type js "getAddress"

Length of output: 9107



Script:

#!/bin/bash
# Inspect the implementation of getAddress to verify error handling
cat packages/viem-effect/src-viem/_esm/utils/address/getAddress.js

Length of output: 1070

packages/contract/src/event/Event.ts (2)
  • 32-33: The type alias TAddressArgs is a conditional type that provides an empty object or an object with an address property based on TAddress. This is a good use of TypeScript's type system to enforce function parameter requirements conditionally.
  • 73-73: The spread operator ...TAddressArgs is used correctly to conditionally add the address property to the event filter parameters. This maintains type safety and flexibility.
bundler/runtime/src/generateTevmBodyDts.spec.ts (2)
  • 57-57: The JSDoc comment correctly documents the MyContract object, which is helpful for developers to understand the purpose and usage of the contract.
  • 61-61: The export statement for MyContract is clear and concise, correctly exporting the contract as a constant.
tevm/docs/modules/vm.md (1)
  • 38-38: The customPredeploys property in the CreateEVMOptions type alias has been simplified to accept an array of CustomPredeploy with two generic types instead of four. This change should be verified to ensure it aligns with the intended use of customPredeploys.
Verification successful

The CustomPredeploy type and the definePredeploy function have been verified. The change to customPredeploys accepting two generic types is consistent with its usage in the codebase, as seen in the test file predeploy.spec.ts. The simplification aligns with the intended use of customPredeploys.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the usage of customPredeploys throughout the codebase
rg --type ts "customPredeploys"

Length of output: 188



Script:

#!/bin/bash
# Examine the definition of CustomPredeploy in CreateEVMOptions.ts
cat vm/vm/src/CreateEVMOptions.ts

# Look at the usage of customPredeploys in predeploy.spec.ts
cat vm/vm/src/test/predeploy.spec.ts

Length of output: 1876



Script:

#!/bin/bash
# Verify the definition of CustomPredeploy
rg --type ts "CustomPredeploy"

# Verify the definePredeploy function
rg --type ts "definePredeploy"

Length of output: 856



Script:

#!/bin/bash
# Examine the definition of CustomPredeploy and the implementation of definePredeploy
cat vm/predeploys/src/definePredeploy.ts

Length of output: 1184

bundler/base/TestContract.d.ts (1)
  • 125-125: The export of TestContract is updated to use the Contract type instead of TevmContract. This change should be consistent across all related files and usages.
Verification successful

The output from the script indicates that the mention of TevmContract in examples/vite/src/wagmi/WagmiEvents.tsx is within a comment. Since it's not part of the code that would affect the functionality or type definitions, it doesn't contradict the review comment that TestContract should use the Contract type consistently across all related files and usages.

Therefore, the review comment is verified as the actual code has been updated to use Contract instead of TevmContract, and the remaining instance is simply a comment that does not impact the code's operation.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that all instances of TevmContract have been updated to Contract
rg --type ts "TevmContract"

Length of output: 107



Script:

#!/bin/bash
# Check the context of TevmContract usage in WagmiEvents.tsx
rg "TevmContract" examples/vite/src/wagmi/WagmiEvents.tsx

Length of output: 97

packages/contract/src/write/writeFactory.spec.ts (2)
  • 7-7: The contract object is created using the createContract function with the correct properties. This setup is crucial for the subsequent tests.
  • 1-12: > Note: This review was outside the patches, and no patch overlapping with it was found. Original lines [57-57]

The inline snapshot for writeInfo.args is a good practice for testing, ensuring that the function returns the expected arguments.

bundler/runtime/src/generateTevmBody.spec.ts (1)
  • 46-46: The commonjs export of MyContract using createContract is correct and aligns with the changes in the rest of the codebase.
packages/contract/src/read/readFactory.spec.ts (2)
  • 7-7: The contract object is created using the createContract function with the correct properties. This setup is crucial for the subsequent tests.
  • 1-12: > Note: This review was outside the patches, and no patch overlapping with it was found. Original lines [57-57]

The inline snapshot for readInfo.args is a good practice for testing, ensuring that the function returns the expected arguments.

vm/vm/docs/modules.md (1)
  • 38-38: The customPredeploys property in the CreateEVMOptions type alias has been simplified to accept an array of CustomPredeploy with two generic types instead of four. This change should be verified to ensure it aligns with the intended use of customPredeploys.
Verification successful

The output from the shell script indicates that the customPredeploys property is used in two TypeScript files: CreateEVMOptions.ts and predeploy.spec.ts. The change in CreateEVMOptions.ts reflects the update mentioned in the PR summary, where customPredeploys now accepts an array of CustomPredeploy with two generic types.

To verify the alignment of this change with the intended use of customPredeploys, we should examine how customPredeploys is utilized in predeploy.spec.ts. This will help us understand if the simplification from four generic types to two is consistent with its usage in tests, which can be indicative of general usage patterns.


The contents of predeploy.spec.ts show a test case that uses the customPredeploys property. The test creates a predeploy object using definePredeploy and then passes an array containing this object to the customPredeploys property when creating a tevm instance.

The predeploy object is constructed with a contract that is created by createScript, which suggests that the CustomPredeploy type is expected to work with a script-like object. This aligns with the change in CreateEVMOptions.ts where customPredeploys now accepts an array of CustomPredeploy with two generic types.

Given the usage in the test file, it seems that the simplification of the CustomPredeploy type to two generic types is consistent with its intended use, at least in the context of this test. The test does not appear to require four generic types for the CustomPredeploy objects, supporting the change made in the PR.

Based on the information gathered, the review comment is addressed, and the change to customPredeploys aligns with the intended use as evidenced by the test case.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the usage of customPredeploys throughout the codebase
rg --type ts "customPredeploys"

Length of output: 188



Script:

#!/bin/bash
# Examine the usage of customPredeploys in predeploy.spec.ts
cat vm/vm/src/test/predeploy.spec.ts

Length of output: 1426

lsp/ts-plugin/src/decorators/getDefinitionAtPosition.ts (6)
  • 38-38: The variable tevmContractPath has been renamed to ContractPath. Ensure that all references to this variable have been updated accordingly.
  • 41-41: The check for ContractPath being falsy is correct. It ensures that if the path is not found, the original definition is returned without further processing.
  • 47-47: The ContractPath is used correctly to resolve the .d.ts files. This is consistent with the renaming of tevmContractPath to ContractPath.
  • 54-54: The error message correctly reflects the new variable name ContractPath. It's good practice to have descriptive error messages that aid in debugging.
  • 83-83: The error message is consistent with the new variable naming and provides clear feedback when definitions cannot be found.
  • 88-88: The default contract name is set to 'Contract' if the filename cannot be derived from ContractPath. This is a sensible default and aligns with the renaming changes.
packages/contract/src/createContract.spec.ts (8)
  • 1-10: The test setup for createContract looks correct and uses the dummyAbi fixture as expected.
  • 13-13: The test for the contract name is simple and effective, ensuring that the name property is set correctly.
  • 17-17: The test for ABI containment is correct, verifying that the contract's ABI matches the expected format.
  • 21-21: The test for generating a human-readable ABI is good, ensuring that the property is defined.
  • 25-34: The snapshot test for the read function is appropriate, capturing the expected structure of the contract's read functions.
  • 37-46: The snapshot test for the write function is similar to the read function test and is correctly implemented.
  • 50-54: The snapshot test for the events function is correct, ensuring that the contract's events are captured as expected.
  • 59-164: The tests for read, write, and events with an address are comprehensive and use inline snapshots to verify the behavior.
lsp/ts-plugin/src/decorators/getScriptSnapshot.spec.ts (1)
  • 135-147: The generated .d.ts file for solidity files includes the correct import from @tevm/contract and the correct contract types for HelloWorld and HelloWorld2.
packages/contract/src/createScript.spec.ts (9)
  • 1-11: The setup for createScript is correct, including the new properties bytecode and deployedBytecode.
  • 14-16: The tests for bytecode and deployedBytecode are correct, ensuring that the properties are set as expected.
  • 18-19: The test for the contract name is consistent with the previous test in createContract.spec.ts and is correct.
  • 22-23: The test for ABI containment is correct and mirrors the test in createContract.spec.ts.
  • 26-27: The test for generating a human-readable ABI is correct and consistent with the createContract tests.
  • 30-39: The snapshot test for the read function is correct and captures the expected structure of the script's read functions.
  • 43-52: The snapshot test for the write function is correct and consistent with the read function test.
  • 56-60: The snapshot test for the events function is correct, ensuring that the script's events are captured as expected.
  • 65-169: The tests for read, write, and events with an address are comprehensive and use inline snapshots to verify the behavior, including the bytecode and deployedBytecode.
extensions/viem/src/tests/ERC20.sol.ts (2)
  • 2-2: The import statement has been updated to use createScript instead of createTevmContract, which is consistent with the PR's objectives.
  • 292-294: The ERC20 export has been updated to use createScript with a placeholder bytecode value of '0x0'. This change is consistent with the PR's objectives and the AI-generated summary.
vm/client/src/test/ERC20.sol.ts (1)
  • 2-2: The import statement has been updated to reflect the renaming of createTevmContract to createScript. This change is consistent with the PR objectives and the AI-generated summary.
tevm/docs/modules/index.md (4)
  • 15-15: The addition of the Contract type alias is consistent with the PR objectives and the AI-generated summary, which mentions the introduction of a Contract entity.
  • 28-28: The addition of the createContract function is consistent with the PR objectives and the AI-generated summary, which mentions the addition of the createContract function.
  • 179-202: The Contract type alias has been added with a comprehensive set of properties and methods. This change is consistent with the PR objectives and the AI-generated summary, which mentions the introduction of a Contract entity.
  • 360-362: The createContract function has been added to the documentation. This change is consistent with the PR objectives and the AI-generated summary, which mentions the addition of the createContract function.
packages/contract/docs/modules.md (6)
  • 9-15: The type aliases section has been updated to reflect the new naming conventions and additional types. This change aligns with the PR objectives and the AI-generated summary.
  • 19-28: New functions createScript, formatEther, formatGwei, and formatLog have been added to the documentation. Ensure that these functions are properly implemented and tested in the codebase.
Verification successful

The search results confirm the implementation of the functions createScript, formatEther, formatGwei, and formatLog in various .js and .ts files within the codebase. Additionally, there are test files such as formatEther.test.ts, formatGwei.test.ts, and log.test.ts that contain tests for these functions, indicating that they have been tested.

Based on the provided output, it is evident that the new functions added to the documentation are implemented and tested in the codebase.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the implementation of new functions in the codebase
rg --type md 'createScript|formatEther|formatGwei|formatLog'

Length of output: 5193



Script:

#!/bin/bash
# Search for the implementation of the functions in JavaScript or TypeScript files
rg 'createScript|formatEther|formatGwei|formatLog' --type js --type ts

# Search for test cases involving these functions
rg 'createScript|formatEther|formatGwei|formatLog' --type js --type ts --glob '*.{test,spec}.{js,ts}'

Length of output: 52154

* 39-60: The `Contract` type alias has been updated. The optional `bytecode` and `deployedBytecode` properties are now marked as potentially `undefined`, which is a significant change. Ensure that all usages of the `Contract` type are checked for compatibility with this change. * 144-165: The `Script` type alias has been introduced with properties including `bytecode` and `deployedBytecode`. This change is consistent with the PR objectives to separate concerns between `Contract` and `Script`. * 195-215: The `createContract` function has been updated in the documentation. Ensure that the implementation of this function matches the updated signature and that all references to the old `createTevmContract` function have been updated.
Verification successful

The output from the rg command has provided us with several files that contain the createContract export. However, the actual implementation details of the createContract function are not fully visible in the provided output. The file packages/contract/src/index.ts seems to be exporting createContract, which is a strong indication that the actual function definition would be in the packages/contract/src/createContract.js file.

To verify the implementation of the createContract function, we need to view the contents of the createContract.js file. Let's proceed with that.


The contents of createContract.js show that the createContract function is indeed implemented and matches the documentation provided in the modules.md file. The function takes an object with name and humanReadableAbi properties, processes the ABI, and returns a contract object with methods for events, write, and read operations. It also includes a withAddress method that allows setting an address for the contract.

Based on the provided output, the implementation of createContract matches the updated signature in the documentation, and there are no references to the old createTevmContract function, which suggests that the PR's changes have been correctly implemented and the documentation has been updated accordingly.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check for the correct implementation and usage of createContract
rg --type ts 'createContract'
# Ensure no references to the old createTevmContract remain
rg --type ts 'createTevmContract'

Length of output: 24181



Script:

#!/bin/bash
# Search for the definition of `createContract` to verify its signature
ast-grep --lang typescript --pattern $'function createContract($_, $_) { $$$ }'

Length of output: 80



Script:

#!/bin/bash
# Adjust the search pattern to account for different ways `createContract` could be defined or exported
ast-grep --lang typescript --pattern $'export function createContract($_, $_) { $$$ }'
ast-grep --lang typescript --pattern $'export const createContract = ($_,$_,$$$) => $$$'
ast-grep --lang typescript --pattern $'export class $_ { $$$ createContract($_, $_) { $$$ } $$$ }'

Length of output: 277



Script:

#!/bin/bash
# Find the file that likely contains the definition of `createContract`
rg --type ts --files-with-matches 'export.*createContract' | xargs head -n 30

Length of output: 5807



Script:

#!/bin/bash
# Display the contents of the createContract.js file to verify the implementation
cat packages/contract/src/createContract.js

Length of output: 1578

* 225-244: The `createScript` function has been added to the documentation. Verify that this function is implemented and used correctly in the codebase.
Verification successful

The createScript function is implemented in packages/contract/src/createScript.js and is used correctly across various test files, such as vm/vm/src/test/predeploy.spec.ts. The function includes a withAddress method, and there are tests in packages/contract/src/createScript.spec.ts that verify its functionality. Based on the provided context, the implementation and usage of createScript in the codebase are verified.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the implementation and usage of createScript
rg --type ts 'createScript'

Length of output: 1171



Script:

#!/bin/bash
# Check the implementation of createScript
cat packages/contract/src/createScript.js

# Review the test cases for createScript
cat packages/contract/src/createScript.spec.ts

# Examine usage in vm/vm/src/test/predeploy.spec.ts as an example
cat vm/vm/src/test/predeploy.spec.ts

Length of output: 7334

bundler/base/src/bundler.spec.ts (8)
  • 302-308: The test code has been updated to use the new Contract type instead of TevmContract. This change is consistent with the PR objectives and the AI-generated summary.
  • 387-393: The test code has been updated to use the new Contract type instead of TevmContract. This change is consistent with the PR objectives and the AI-generated summary.
  • 481-483: The test code has been updated to use the new createContract function instead of createTevmContract. This change is consistent with the PR objectives and the AI-generated summary.
  • 571-573: The test code has been updated to use the new createContract function instead of createTevmContract. This change is consistent with the PR objectives and the AI-generated summary.
  • 661-663: The test code has been updated to use CommonJS require syntax for importing createContract from @tevm/contract. Ensure that this change is consistent with the module system used in the project.
Verification successful

The project uses a mixed module system, with both CommonJS require and ES module import syntax present, particularly in the generateRuntime.js file. This indicates that the use of CommonJS require syntax in the bundler.spec.ts file is consistent with the project's approach to handling module systems.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that CommonJS require syntax is appropriate for the project
rg --type js 'require\(.@tevm/contract.\)'

Length of output: 246



Script:

#!/bin/bash
# Verify if ES module import syntax is also used for @tevm/contract
rg --type js 'import .* from .@tevm/contract.'

Length of output: 610

* 751-753: The test code has been updated to use CommonJS require syntax for importing `createContract` from `@tevm/contract`. Ensure that this change is consistent with the module system used in the project.
Verification successful

The output from the latest script indicates that both CommonJS require syntax and ES module import syntax are used in the project when importing from @tevm/contract. This suggests that the project may support both module systems or is in the process of transitioning between them. Given this context, the use of CommonJS require syntax in the bundler.spec.ts file is consistent with other parts of the project.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that CommonJS require syntax is appropriate for the project
rg --type js 'require\(.@tevm/contract.\)'

Length of output: 246



Script:

#!/bin/bash
# Check for any ES module import syntax for @tevm/contract to verify consistency
rg --type js 'import .* from .@tevm/contract.'

Length of output: 610

* 841-843: The test code has been updated to use ES module syntax for importing `createContract` from `@tevm/contract`. This change is consistent with the PR objectives and the AI-generated summary. * 931-933: The test code has been updated to use ES module syntax for importing `createContract` from `@tevm/contract`. This change is consistent with the PR objectives and the AI-generated summary.

Comment on lines +292 to +294
export const ERC20 = createScript({
humanReadableAbi: formatAbi(ERC20_ABI),
bytecode: undefined,
bytecode: '0x0',
Copy link
Contributor

Choose a reason for hiding this comment

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

The ERC20 export has been updated to use createScript instead of createTevmContract, and the bytecode property has been changed from undefined to '0x0'. The change to createScript aligns with the PR objectives and the AI-generated summary. However, setting the bytecode to '0x0' may not be correct if the intention is to indicate that there is no bytecode. Typically, a non-deployed contract would have undefined bytecode, while '0x0' suggests a bytecode that is simply empty, which could have different implications in the context of Ethereum smart contracts.

Consider reverting the bytecode property to undefined if the intention is to indicate a non-deployed contract, or clarify the intention behind setting it to '0x0'.

bytecode,
deployedBytecode,
}) => {
const abi = parseAbi(/**@type any*/ (humanReadableAbi))
Copy link
Contributor

Choose a reason for hiding this comment

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

The use of /**@type any*/ to cast humanReadableAbi to any bypasses TypeScript's type checking. Consider using a more specific type to benefit from type safety.

- const abi = parseAbi(/**@type any*/ (humanReadableAbi))
+ // Assuming parseAbi can accept the type returned by humanReadableAbi
+ const abi = parseAbi(humanReadableAbi)

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.

Suggested change
const abi = parseAbi(/**@type any*/ (humanReadableAbi))
// Assuming parseAbi can accept the type returned by humanReadableAbi
const abi = parseAbi(humanReadableAbi)

Comment on lines +28 to +32
events: eventsFactory({ abi, bytecode, deployedBytecode }),
// TODO make this more internally typesafe
write: writeFactory({ methods, bytecode, deployedBytecode }),
// TODO make this more internally typesafe
read: readFactory({ methods, bytecode, deployedBytecode }),
Copy link
Contributor

Choose a reason for hiding this comment

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

The TODO comments indicate a need to make the code more internally typesafe. It's important to address these TODOs to avoid potential runtime errors due to type mismatches.

Would you like me to help with making the code more internally typesafe?

* @notice MyContract
* @property balanceOf(address) Returns the amount of tokens owned by account
*/
export const MyContract: TevmContract<typeof _nameMyContract, typeof _abiMyContract, undefined, undefined>;
export const MyContract: Contract<typeof _nameMyContract, typeof _abiMyContract>;
Copy link
Contributor

Choose a reason for hiding this comment

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

The shell script output indicates that there is at least one instance where TevmContract is still mentioned in the codebase, specifically within the file examples/vite/src/wagmi/WagmiEvents.tsx. This suggests that not all instances of TevmContract have been updated to Contract, which is inconsistent with the PR's objective of standardizing the naming convention across the codebase.

Analysis chain

The TypeScript declaration for MyContract is updated to use the Contract type, which should be verified for consistency across the codebase.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that all instances of TevmContract have been updated to Contract
rg --type ts "TevmContract"

Length of output: 107

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a51d3b8 and 78aaa35.
Files selected for processing (1)
  • tevm/contract/index.ts (1 hunks)
Additional comments: 1
tevm/contract/index.ts (1)
  • 2-20: The changes in the export declarations align with the PR objectives and AI-generated summary, which indicate a renaming and addition of types and functions to enhance the smart contract API. Ensure that all dependent modules that import these entities are updated to reflect the new names and additions.

@github-actions github-actions bot mentioned this pull request Jan 17, 2024
roninjin10 pushed a commit that referenced this pull request Jan 17, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`main` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `main`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases
## @tevm/[email protected]

### Major Changes

- [#828](#828)
[`3b5f6729`](3b5f672)
Thanks [@roninjin10](https://github.com/roninjin10)! - - Changed name of
`TevmContract` to `Contract`

    -   Changed name of `createTevmContract` to `createContract`
    -   Added `Script` to be a Contract with bytecode
    -   Removed bytecode from `Contract`
- Added a new `withAddress` method for adding an address to a contract
    -   Removed need to explicitly pass in undefined for optional params

    ## withAddress

    Before we had to spred contracts like this:

    ```typescript
    client.readContract({
      address: contractAddress,
      ...Erc20Contract.read.balanceOf(userAddress),
    });
    ```

    Now Tevm can create a contract with an address attatched

    ```typescript
    client.readContract(
Erc20Contract.withAddress(contractAddress).read.balanceOf(userAddress)
    );
    ```

## @tevm/[email protected]

### Minor Changes

- [#822](#822)
[`39a5b5e5`](39a5b5e)
Thanks [@roninjin10](https://github.com/roninjin10)! - Added eth methods
such as chainId getCode and getStorageAt to Tevm.eth.

### Patch Changes

- [#804](#804)
[`d514d111`](d514d11)
Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with
viem extension not decoding rawData into data

- Updated dependencies
\[[`8b3218b1`](8b3218b),
[`39a5b5e5`](39a5b5e),
[`98d76506`](98d7650)]:
    -   @tevm/[email protected]

## [email protected]

### Minor Changes

- [#822](#822)
[`39a5b5e5`](39a5b5e)
Thanks [@roninjin10](https://github.com/roninjin10)! - Added eth methods
such as chainId getCode and getStorageAt to Tevm.eth.

### Patch Changes

- [#804](#804)
[`d514d111`](d514d11)
Thanks [@roninjin10](https://github.com/roninjin10)! - Update tevm
package to export all of tevm. Now users only need to `npm install tevm`
to use all of tevm

- Updated dependencies
\[[`87427f30`](87427f3),
[`8b3218b1`](8b3218b),
[`cae17b7d`](cae17b7),
[`39a5b5e5`](39a5b5e),
[`3b5f6729`](3b5f672),
[`0ee22d0a`](0ee22d0),
[`0ee22d0a`](0ee22d0),
[`d514d111`](d514d11),
[`941a630a`](941a630),
[`98d76506`](98d7650)]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]

## @tevm/[email protected]

### Minor Changes

- [#820](#820)
[`cae17b7d`](cae17b7)
Thanks [@roninjin10](https://github.com/roninjin10)! - Added all eth_\*
debug_\_ and anvil\_\_ JSON-rpc methods and handlers to API.

- [#822](#822)
[`39a5b5e5`](39a5b5e)
Thanks [@roninjin10](https://github.com/roninjin10)! - Added eth methods
such as chainId getCode and getStorageAt to Tevm.eth.

### Patch Changes

- [#811](#811)
[`87427f30`](87427f3)
Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with
EVM errors requiring importing ethereumjs enum to typematch

- [#800](#800)
[`0ee22d0a`](0ee22d0)
Thanks [@roninjin10](https://github.com/roninjin10)! - Renamed
TevmClient type to Tevm

- [#800](#800)
[`0ee22d0a`](0ee22d0)
Thanks [@roninjin10](https://github.com/roninjin10)! - Added JSDOC to
@tevm/api

- [#808](#808)
[`941a630a`](941a630)
Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with
'to' and 'error' properties not quite working correctly for tevm. To was
listed as require instead of only existing when no errors.

## @tevm/[email protected]

### Minor Changes

- [#805](#805)
[`8b3218b1`](8b3218b)
Thanks [@0xNonCents](https://github.com/0xNonCents)! - Enable State Load
and Dump actions

- [#822](#822)
[`39a5b5e5`](39a5b5e)
Thanks [@roninjin10](https://github.com/roninjin10)! - Added eth methods
such as chainId getCode and getStorageAt to Tevm.eth.

- [#823](#823)
[`f7865314`](f786531)
Thanks [@roninjin10](https://github.com/roninjin10)! - Added support for
debug_traceCall handler

### Patch Changes

- [#804](#804)
[`d514d111`](d514d11)
Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with
tevm account not updating code hash when deployedBytecode is put into
state

- Updated dependencies
\[[`3b4a347d`](3b4a347),
[`39a5b5e5`](39a5b5e),
[`d514d111`](d514d11),
[`d514d111`](d514d11),
[`aec294ba`](aec294b)]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]

## @tevm/[email protected]

### Minor Changes

- [#805](#805)
[`8b3218b1`](8b3218b)
Thanks [@0xNonCents](https://github.com/0xNonCents)! - Enable State Load
and Dump actions

## @tevm/[email protected]

### Minor Changes

- [#805](#805)
[`8b3218b1`](8b3218b)
Thanks [@0xNonCents](https://github.com/0xNonCents)! - Enable State Load
and Dump actions

- [#822](#822)
[`39a5b5e5`](39a5b5e)
Thanks [@roninjin10](https://github.com/roninjin10)! - Added eth methods
such as chainId getCode and getStorageAt to Tevm.eth.

- [#818](#818)
[`98d76506`](98d7650)
Thanks [@roninjin10](https://github.com/roninjin10)! - Added blockchain
to the Tevm VM so anvil, hardhat, and eth_json_rpc requests can be
handled

### Patch Changes

- Updated dependencies
\[[`87427f30`](87427f3),
[`d514d111`](d514d11),
[`39a5b5e5`](39a5b5e),
[`8b3218b1`](8b3218b),
[`d514d111`](d514d11),
[`cae17b7d`](cae17b7),
[`39a5b5e5`](39a5b5e),
[`3b5f6729`](3b5f672),
[`0ee22d0a`](0ee22d0),
[`0ee22d0a`](0ee22d0),
[`941a630a`](941a630),
[`f7865314`](f786531)]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

- Updated dependencies
\[[`3b5f6729`](3b5f672)]:
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

- [#822](#822)
[`39a5b5e5`](39a5b5e)
Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with
swallowing errors that didn't return text

- [#804](#804)
[`d514d111`](d514d11)
Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with
checking method falsely

## @tevm/[email protected]

### Patch Changes

- Updated dependencies
\[[`8b3218b1`](8b3218b),
[`39a5b5e5`](39a5b5e),
[`3b5f6729`](3b5f672),
[`d514d111`](d514d11),
[`98d76506`](98d7650)]:
    -   @tevm/[email protected]
    -   @tevm/[email protected]
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

- Updated dependencies
\[[`3b5f6729`](3b5f672)]:
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

- [#809](#809)
[`0efe3b03`](0efe3b0)
Thanks [@roninjin10](https://github.com/roninjin10)! - Added jsdoc to
createHttpHandler

- Updated dependencies
\[[`3b4a347d`](3b4a347),
[`d514d111`](d514d11),
[`aec294ba`](aec294b)]:
    -   @tevm/[email protected]

## @tevm/[email protected]

### Patch Changes

- [#807](#807)
[`3b4a347d`](3b4a347)
Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with
zod validator swallowing missing `to` parameter errors

- [#804](#804)
[`d514d111`](d514d11)
Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with
JsonRpcRequest throwing for requests with no params

- [#806](#806)
[`aec294ba`](aec294b)
Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug in zod
validators for contract params which falsely listed `to` as optional

- Updated dependencies
\[[`87427f30`](87427f3),
[`cae17b7d`](cae17b7),
[`39a5b5e5`](39a5b5e),
[`0ee22d0a`](0ee22d0),
[`0ee22d0a`](0ee22d0),
[`941a630a`](941a630)]:
    -   @tevm/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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