Skip to content
Truffle Flattener concats solidity files developed under Truffle with all of their dependencies
Branch: master
Clone or download
alcuadrado Merge pull request #43 from jcarpanelli/feature/root-argument
Add root argument to `flatten` function
Latest commit 6935a19 Jun 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests Add root argument to flatten function Jun 13, 2019
.gitignore command line - adding `--output` mode 👍 Jul 29, 2018
LICENSE
README.md add link to npm package May 7, 2019
index.js Add root argument to flatten function Jun 13, 2019
package-lock.json New version released Feb 13, 2019
package.json New version released Feb 13, 2019

README.md

truffle-flattener

npm

Truffle Flattener concats solidity files developed under Truffle with all of their dependencies.

This tool helps you to verify contracts developed with Truffle on Etherscan, or debugging them on Remix, by merging your files and their dependencies in the right order.

Check out Buidler, our alternative to Truffle. It's got flattening built-in, it's faster, and much more flexible.

Installation

npm install truffle-flattener -g

Usage

Just intall it with npm in your truffle project and run truffle-flattener <solidity-files>.

Why not Solidity Flattener?

This project is a Truffle specific reimplementation of Solidity Flattener. By being closely coupled to Truffle it can take advantage of its dependencies resolution logic making --solc-paths a thing of the past. It also supports flattening more than one file at once, concatenating everything in the right order, whithout duplicating any file.

Limitations

If you deploy your contracts with truffle's migrations the output of truffle-flattener may not match while verifying it in Etherscan. You can use Solidity Flattener in that case, or deploy your contracts from Remix.

Aliased imports (eg: import {symbol1 as alias, symbol2} from "filename";) are not supported by truffle-flattener.

You can’t perform that action at this time.