Closed andreafspeziale closed 6 years ago
solidity_flattener --solc-path="--allow-paths $PWD/node_modules/zeppelin-solidity/ zeppelin-solidity=$PWD/node_modules/zeppelin-solidity" contracts/MyToken.sol
You are welcome.
I'll try as soon as possible and give u back a feedback thank you so much @denisglotov
@denisglotov It seems not working:
solidity_flattener --solc-path="--allow-paths $PWD/node_modules/zeppelin-solidity/ zeppelin-solidity=$PWD/node_modules/zeppelin-solidity" contracts/SpaghettiCoin.sol
unrecognised option '--allow-paths /Users/andreaspeziale/Repository/learning/spaghetti-sale/node_modules/zeppelin-solidity/ zeppelin-solidity=/Users/andreaspeziale/Repository/learning/spaghetti-sale/node_modules/zeppelin-solidity'
Traceback (most recent call last):
File "/Users/andreaspeziale/Repository/learning/spaghetti-sale/env/bin/solidity_flattener", line 4, in <module>
flattener.core.main()
File "/Users/andreaspeziale/Repository/learning/spaghetti-sale/env/lib/python3.7/site-packages/flattener/core.py", line 97, in main
solc_proc.check_returncode()
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 409, in check_returncode
self.stderr)
subprocess.CalledProcessError: Command '['solc', '--allow-paths /Users/andreaspeziale/Repository/learning/spaghetti-sale/node_modules/zeppelin-solidity/ zeppelin-solidity=/Users/andreaspeziale/Repository/learning/spaghetti-sale/node_modules/zeppelin-solidity', '--ast', 'contracts/SpaghettiCoin.sol']' returned non-zero exit status 1.
This is my sample project :) https://github.com/andreafspeziale/spaghetti-sale
Thanks for the help.
Any chance to have some help? This repository is siggested by etherscan and I’m wondering why am I having all of this trouble :(. Thanks so much!
@andreafspeziale --allow-paths takes a comma separated list, not space separated
e.g. solc --allow-paths ./lib,./ens,
(this is what i use - also author of patch to introudce --solc-paths to this repo, not sure why but the --allow-paths
used to be autoinjected but fell off during somewhere)
also note the trailing ,
- not sure why but solc seems to not like it if this is omitted
Thanks for the help @XertroV. I've been able to flat my contract as follow:
solidity_flattener --solc-path="solc --allow-paths $PWD/node_modules/zeppelin-solidity/ zeppelin-solidity=$PWD/node_modules/zeppelin-solidity" contracts/Contract.sol --output $PWD/flattened/SpaghettiCoin.sol
It seems I was just missing the solc keyword before --allow-.......
--solc-path="solc --allow-paths
Thanks again!
@andreafspeziale glad you got it working.
It's weird that adding solc
to the start worked.. I wouldn't expect it to given this line: https://github.com/BlockCatIO/solidity-flattener/blob/53b01d1db12a5ef4dfe35adf4bd6e4f73d90d0f8/flattener/core.py#L93
In any case 👍
@XertroV Yes i noticed it. Actually I don't know maybe I'm missing something else but it worked. Give a look to those two tracebacks. The first one worked the second one nope and the diff is only the solc prefix.
(env) ➜ spaghetti-sale git:(master) solidity_flattener --solc-path="solc --allow-paths $PWD/node_modules/zeppelin-solidity/ zeppelin-solidity=$PWD/node_modules/zeppelin-solidity" contracts/SpaghettiCoin.sol --output $PWD/flattened/SpaghettiCoin.sol
(env) ➜ spaghetti-sale git:(master) solidity_flattener --solc-path="--allow-paths $PWD/node_modules/zeppelin-solidity/ zeppelin-solidity=$PWD/node_modules/zeppelin-solidity" contracts/SpaghettiCoin.sol --output $PWD/flattened/SpaghettiCoin.sol
unrecognised option '--allow-paths /Users/andreaspeziale/Repository/learning/spaghetti-sale/node_modules/zeppelin-solidity/ zeppelin-solidity=/Users/andreaspeziale/Repository/learning/spaghetti-sale/node_modules/zeppelin-solidity'
Traceback (most recent call last):
File "/Users/andreaspeziale/Repository/learning/spaghetti-sale/env/bin/solidity_flattener", line 4, in <module>
flattener.core.main()
File "/Users/andreaspeziale/Repository/learning/spaghetti-sale/env/lib/python3.7/site-packages/flattener/core.py", line 97, in main
solc_proc.check_returncode()
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 409, in check_returncode
self.stderr)
subprocess.CalledProcessError: Command '['solc', '--allow-paths /Users/andreaspeziale/Repository/learning/spaghetti-sale/node_modules/zeppelin-solidity/ zeppelin-solidity=/Users/andreaspeziale/Repository/learning/spaghetti-sale/node_modules/zeppelin-solidity', '--ast', 'contracts/SpaghettiCoin.sol']' returned non-zero exit status 1.
(env) ➜ spaghetti-sale git:(master)
Traceback (most recent call last):
File "/Users/andreaspeziale/Repository/learning/spaghetti-sale/env/bin/solidity_flattener", line 4, in <module>
flattener.core.main()
File "/Users/andreaspeziale/Repository/learning/spaghetti-sale/env/lib/python3.7/site-packages/flattener/core.py", line 97, in main
solc_proc.check_returncode()
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 409, in check_returncode
self.stderr)
subprocess.CalledProcessError: Command '['solc', '--allow-paths /Users/andreaspeziale/Repository/learning/spaghetti-sale/node_modules/zeppelin-solidity/ zeppelin-solidity=/Users/andreaspeziale/Repository/learning/spaghetti-sale/node_modules/zeppelin-solidity', '--ast', 'contracts/SpaghettiSale.sol']' returned non-zero exit status 1.
(env) ➜ spaghetti-sale git:(master)
unrecognised option '--allow-paths...
Have a nice day!
Hi, I was trying to flat a very simple contract just to test the library and python requirements:
and I get this:
The
$ truffle compile
works well.Thank you for the help.