Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Unfolds all local imports in a solidity file to generate a flat solidity file.
Manually combining all imports in a solidity file when verifying your contract source on Etherscan is time-consuming and cumbersome. This tool automatically traverses the dependency graph of imports and combines them in the correct order, which is ready to be pasted into the contract verifier.
NOTE: This tool won't work with imports that are aliased (i.e. import "./foo.sol" as bar; )
There are no requirements for this tool.
pip3 install solflatliner
or if you want to get the upgrade
sudo pip3 install solflatliner --upgrade
#!/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8
# -*- coding: utf-8 -*-
import re
import sys
from solflatliner.cmd import cli
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(cli())
usage: solflatliner [-h] [-o *.sol] *.sol *.*.*
Unfolds all local imports in a solidity file to generate a flat solidity file.
Put the output file into out/ folders.
positional arguments:
*.sol Target filename with imports
*.*.* Solidity compiler version e.g. 0.4.24
optional arguments:
-h, --help Show this help message and exit
-o *.sol, --output *.sol
Output filename (default: flat.sol)
-f, --ofolder The output folder (default: verify)
-lib, --library Selection of library folder from the execution path. (default: lib)
-l, --license The license identifier from https://spdx.org/licenses/ (default: AGPL-3.0)
solu contract-with-imports.sol 0.4.24
It will output flat.sol
(default output filename) with solidity version 0.4.24
in verify/
folder.
solflatliner contract-with-imports.sol 0.4.20 --output contract-flat.sol
It will output contract-flat.sol
with solidity version 0.4.20
in verify/
folder.
MIT License (2022), Jun-You Liu, Heskemo
FAQs
A Python package to unfold soldity code with imports into a single file.
We found that solflatliner demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.