A Python package to unfold soldity code with imports into a single file.
Project description
Solidity Flatliner
Unfolds all local imports in a solidity file to generate a flat solidity file.
Introduction
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; )
Installation
There are no requirements for this tool.
pip install solflatliner
Usage
usage: solu [-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)
Example
solu contract-with-imports.sol 0.4.24
It will output flat.sol
(default output filename) with solidity version 0.4.24
in out/
folder.
solu contract-with-imports.sol 0.4.20 --output contract-flat.sol
It will output contract-flat.sol
with solidity version 0.4.20
in out/
folder.
Contact
Feel free to contact me if there's any problem. And welcome to open issues and send pull requests.
Inspired by BlockCatIO.
License
MIT License (2018), Jun-You Liu
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for solflatliner-1.0.106-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e52f301e1b9450115fe39bdf66e6a405faf57ce5fb03edf9df3739fd5202f28 |
|
MD5 | f3bce333b21db37942d1c23bf3010282 |
|
BLAKE2b-256 | b606fedbdffb12962ad290eaf2e5b61b93badcef941697c5bcfeb5e7f55c6bea |