Go to file
Viktor Baranov 4ccc21dc1e 3.0.9 2023-02-23 13:39:16 +03:00
.github/workflows Update CI config 2023-02-23 13:37:07 +03:00
demo Last portion of refactoring 2018-09-06 16:48:46 +03:00
helpers fix lint errors 2020-09-09 16:48:42 +08:00
test Update test constants 2018-09-06 17:09:18 +03:00
.eslintrc.json Unit test for changeRelativePathToAbsoluteTest 2018-09-06 13:30:13 +03:00
.gitignore Unit test for changeRelativePathToAbsoluteTest 2018-09-06 13:30:13 +03:00
.travis.yml Allow node engine ^12 current LTS 2020-05-22 11:59:59 -02:30
LICENSE.md added Apache2 license 2017-07-26 10:58:32 -07:00
README.md Update readme 2020-05-20 16:29:47 +03:00
config.json Flat .sol file generation utility 2017-07-26 19:13:45 +03:00
index.js formatting 2020-09-09 16:53:15 +08:00
package-lock.json 3.0.9 2023-02-23 13:39:16 +03:00
package.json 3.0.9 2023-02-23 13:39:16 +03:00

README.md

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"
}