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

Instatiating a contract from an ABI locally #1594

Open
CadeMichael opened this issue Jul 9, 2024 · 2 comments
Open

Instatiating a contract from an ABI locally #1594

CadeMichael opened this issue Jul 9, 2024 · 2 comments
Labels

Comments

@CadeMichael
Copy link

I'm digging through some of the documentation to build a Contract object from an abi and execute transactions with it on the Evm. It seems like all of the docs and tutorials I've found point to using a contract from a pre existing chain and then running tests / simulations with it. Is there a standard approach to get a contract locally for running with REVM? Some of the relevant docs I've found include 'BundleState' but I'm not sure how to properly tie this into an 'Evm::builder()' to have the contract exist in the running Evm instance.

https://bluealloy.github.io/revm/docs/revm/db/states/bundle_state/struct.BundleBuilder.html#method.contract

I see that you can use a BundleBuilder and use 'build()' to get the BundleState out of it, but I'm getting lost on going from BundleState to changing the Evm. I'm thinking possibly BundleState::extend() but I'm not sure. If there is a clear solution that's going over my head I'd be happy to add it to the docs.

@DaniPopes
Copy link
Collaborator

An ABI just tells you what inputs are valid for a certain bytecode, it doesn't say anything about the environment. You need to get that information either from an rpc or build it yourself locally

@CadeMichael
Copy link
Author

Are there any docs on building it locally ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants