Giter Club home page Giter Club logo

Comments (11)

cedricwalter avatar cedricwalter commented on May 18, 2024 1

@alcuadrado I've added and test a PR to solve that issue: #10

from truffle-flattener.

frangio avatar frangio commented on May 18, 2024

It may be possible to get the Truffle root from truffle-config (the package)...

from truffle-flattener.

tomasienrbc avatar tomasienrbc commented on May 18, 2024

@frangio not related to this bug but how is the config file used? What does truffle-flattener need from truffle.js at the moment?

I've been thinking it would be cool to include sample code for how to add truffle-flattener to your project and add a command so it automatically flattens all your files at build time and adds them to a flattened folder, what do you think?

from truffle-flattener.

alcuadrado avatar alcuadrado commented on May 18, 2024

It's only used to find the root of the project. As @frangio said, truffle-config can do this.

I've been working on this change, which is really simple. But the code got too messy, so I'll work on a refactor before implementing this.

from truffle-flattener.

tomasienrbc avatar tomasienrbc commented on May 18, 2024

@alcuadrado thanks! Do you have anywhere I should look for how to implement truffle-flattener in my truffle build config or something similar? I think it's really important for all deploys to be done with flattened files for later verification so I want to automate that. If not I can probably figure it out, any starting point would be helpful though!

from truffle-flattener.

alcuadrado avatar alcuadrado commented on May 18, 2024

Can you expand more on that idea? I'm not sure if I'm following you.

from truffle-flattener.

tomasienrbc avatar tomasienrbc commented on May 18, 2024

@alcuadrado totally!

So right now it works great to install truffle-flattener and then run terminal or command line commands to get an output of a flattened file.

What should I do if I want to include truffle-flattener in my truffle package.json and run commands in truffle.js to force it to create a new, flattened file on each deploy. Have you done anything like that before, or do you just use it from the terminal and copy/paste the results to use them?

from truffle-flattener.

alcuadrado avatar alcuadrado commented on May 18, 2024

@tomasienrbc I still don't get your point. Truffle also flattens the source code. If you run this tool after deploying with truffle you should get the code needed to verify the contract. Doesn't it work for you?

from truffle-flattener.

tomasienrbc avatar tomasienrbc commented on May 18, 2024

Actually you won't - the flattener adds extra spacing and comments. For whatever reason, comments and spacing impact the bytecode that is generated, so if there's any extra spacing in the flattener you can't verify the contract. That's why I want to set this up so that the actual deployed contract is the flattened one.

I don't know enough about the solidity compiler to know why this is the case but it is. So I want to run this in my actual truffle deploy script, do you think that could be possible?

from truffle-flattener.

cedricwalter avatar cedricwalter commented on May 18, 2024

Hallo

This is something you should better ask in the trufflesuite project...maybe it is even.possible to build in the migrate/build either with a hook or a command switch

from truffle-flattener.

alcuadrado avatar alcuadrado commented on May 18, 2024

I'm closing this issue as it has been fixed by @cedricwalter.

Can we follow your issue on #12 @tomasienrbc ? Can you point me to an example please?

from truffle-flattener.

Related Issues (20)

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.