Comments (11)
@alcuadrado I've added and test a PR to solve that issue: #10
from truffle-flattener.
It may be possible to get the Truffle root from truffle-config
(the package)...
from truffle-flattener.
@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.
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.
@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.
Can you expand more on that idea? I'm not sure if I'm following you.
from truffle-flattener.
@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.
@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.
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.
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.
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)
- Solidity 0.7.0 constructor without modifier breaks parser HOT 3
- Format is incorrect if import is separated into multiple lines HOT 1
- Does Not Support Pragma Statement Including `||` HOT 1
- Will support hardhat? HOT 4
- Crashes when pathname includes spaces. HOT 2
- Invalid Path Problem HOT 1
- Support for HardHat HOT 3
- None of the sub-resolvers resolved "nft\node_modules\@openzeppelin\contracts\token\ERC721\ERC721Full.sol" location. HOT 7
- truffle-flattener output has multiple SPDX licenses HOT 1
- Cannot verify SmartContract on BSCscan.. help please to flatten code? HOT 1
- Could not parse smart contract with "unchecked block" syntax HOT 18
- TypeError: Definition of base has to precede definition of derived contract abstract contract HOT 2
- How to export the flattened version generated by truffle-flattener? HOT 3
- solidity 0.8.0,truffle-flattener,packaging sol file problem HOT 6
- npx github:fedeb95/truffle-flattener is error!!! HOT 2
- Remove truffle env dependence HOT 1
- Add output file option HOT 4
- Error: None of the sub-resolvers resolved "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol" location. HOT 2
- SPDX-License-Identifier: MIT
- pragma is not defined
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from truffle-flattener.