All Projects → poanetwork → Solidity Flattener

poanetwork / Solidity Flattener

Licence: apache-2.0
Utility to combine Solidity project to a flat file

Programming Languages

javascript
184084 projects - #8 most used programming language
solidity
1140 projects

Solidity smart-contract flattened source file generation

Build Status Known Vulnerabilities Coverage Status

Utility to combine all imports to one flatten .sol file

Installation from npm

npm i @poanet/solidity-flattener

Usage

./node_modules/.bin/poa-solidity-flattener ./contracts/example.sol

It will save flattened source of Solidity smart-contract into ./out directory

Installation from source

git clone https://github.com/poanetwork/solidity-flattener
cd solidity-flattener
npm install

You can start script either

npm start "path_to_not_flat_contract_definition_file.sol"

or without paramaters (path to input file will be extracted from ./config.json)

npm start

Expected result:

Success! Flat file ORIGINAL_FILE_NAME_flat.sol is generated to ./out directory

./flatContract.sol - flat .sol file is created in output directory (./out/ by default)

Note: utility doesn't support aliases at import statements

Config

path ./config.json

{
	"inputFilePath": "./demo/src/Oracles.sol",
	"outputDir": "./out"
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].