Code Monkey home page Code Monkey logo

Comments (8)

ItsNickBarry avatar ItsNickBarry commented on May 19, 2024 1

Yes, I think for now forking is best. I might consider releasing a generalized plugin for exporting any combination of data from artifacts, but not at the moment. Let me know if you have any issues modifying the code.

from hardhat-abi-exporter.

ItsNickBarry avatar ItsNickBarry commented on May 19, 2024

This plugin extracts contract ABI fields from artifacts and exports them as top-level JSON objects in their own files. Additional data could be included in one of two ways: (1) nesting all data, including ABI, within the same JSON object; (2) creating separate output files.

The first will not work, because it breaks the API and, in my opinion, defeats the purpose of exporting data from the artifacts in the first place.

The second might work, but I think would be more suitable as its own plugin. If you help me to understand the use case for bytecode export a bit better, I will consider releasing that. (Alternatively, you could probably fork this repository and do it yourself by changing only a couple of lines.)

from hardhat-abi-exporter.

tomasmik avatar tomasmik commented on May 19, 2024

The second might work, but I think would be more suitable as its own plugin. If you help me to understand the use case for bytecode export a bit better, I will consider releasing that. (Alternatively, you could probably fork this repository and do it yourself by changing only a couple of lines.)

I have no problem with forking and making my own changes, just though I would throw it out as an idea.

My main problem is that abi files only are not enough to generate bindings and have the DeployX functions. To get "full" bindings which you can use to deploy the contract you need both abi and bytecode.
Take a look here under section: Deploying contracts to Ethereum

from hardhat-abi-exporter.

ItsNickBarry avatar ItsNickBarry commented on May 19, 2024

I suppose my question is why it would be more convenient to export this data rather than just use use the artifacts. My reasoning for exporting ABIs is that they can be added to version control in a contract repositiory, and imported as a dependency into a dapp repository. That way the dapp repositiory does not have to handle compilation. Would a similar workflow be useful for generating the bindings you need? Or would it be better to incorporate the whole process into a plugin?

from hardhat-abi-exporter.

tomasmik avatar tomasmik commented on May 19, 2024

Would a similar workflow be useful for generating the bindings you need? Or would it be better to incorporate the whole process into a plugin?

Yes. It's a bit more convenient to have two different files for bytecode and abi in version control for when you want to generate bindings. You can sort of kind of do it from a single artifact file, but you also bring unneeded things with it.
If you dont see this as a beneficial flag for this specific package, I have no problem wtih forking and making my own changes though.

from hardhat-abi-exporter.

fabioDMFerreira avatar fabioDMFerreira commented on May 19, 2024

This may be useful! I am building a hardhat plugin that requires a contract bytecode in the integration tests but I would like to maintain the contracts in a separate package.

Probably it makes sense to have its own dedicated repo, but for my use case, I just need the bytecode files mirrored in a different directory. With a couple of lines, we could easily support it.

from hardhat-abi-exporter.

yazzaoui avatar yazzaoui commented on May 19, 2024

Hello ! Would have been amazing to have this feature supported!

from hardhat-abi-exporter.

ItsNickBarry avatar ItsNickBarry commented on May 19, 2024

Bytecode exporter plugin released: https://github.com/solidstate-network/hardhat-bytecode-exporter

from hardhat-abi-exporter.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.