This command-line utility flattens and/or merges Solidity files.
sudo npm install -g sol-flattener
CLI Arguments
- Path to the source file.
- Path to generate the flattened file to.
- Search paths.
- Remove redundant empty lines. Default: false.
How to Use sol-flattener?
On your project root, run the following command.
sol-flattener ./contracts/Token.sol ./flattened/Token.sol .,../node_modules
Alternatively, you can create sol-flattener.json
configuration file in your project root.
{
"source": "../vesting-schedule/contracts/VestingSchedule.sol",
"destination": "../vesting-schedule/flattened/VestingSchedule.sol",
"search": "./,../node_modules",
"removeRedundantEmptyLines": true
}
and then call sol-flattener
instead of passing any command line argument.