Skip to content

sbip-sg/sol-flattener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

sol-flattener

Mimimal solidity flattener script. No dependencies.

Most analysis tools require the file to be self-contained and compilable directly with solc. This helps flatten solidity file from project folder structure to a single file to be used for tools or to be uploaded to etherscan.

Requirements:

  • Python 3

Usage:

Normal project:

  • python flatten.py --path yourfile.sol
  • python flatten.py --path yourfile.sol --output /temp/

Hardhat + truffle projects:

  • Install npm dependencies
    • cd project_folder
    • npm install or yarn install
  • python flatten.py --path project_folder/contracts/Contract.sol --include project_folder/node_modules

Test the flattened sol file with the correct solc version : solc Contract_flattened.sol --binary

About

Mimimal solidity flattener script

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages