solc-js icon indicating copy to clipboard operation
solc-js copied to clipboard

Change rules for selecting filename for generated files

Open krzkaczor opened this issue 6 years ago • 6 comments

Closes https://github.com/ethereum/solc-js/issues/219. Behaviour is now the same as for native solc.

EDITED by @r0qs: I pushed my attempt to finish this PR. It adds the overwrite flag and tests to it. The first commit was necessary to allow the tests to clean the .bin and .abi artifacts generated by the test cases. Before, they weren't clean after each run, and with the addition of the overwrite functionality, they would not work.

krzkaczor avatar Jun 10 '18 01:06 krzkaczor

Coverage Status

Coverage: 84.729% (+0.2%) from 84.537% when pulling 5b5bd05ae4d8169924c4660217d02b53903b6277 on krzkaczor:kk/fix-cli-output-filename into c572d36fdad98dde5d3434cd21362830d2b59d40 on ethereum:master.

coveralls avatar Jun 10 '18 01:06 coveralls

solc is looking for collisions. If there are none, it uses the contract name, otherwise the fully qualified name with : and others replaced by _

chriseth avatar Nov 13 '18 13:11 chriseth

@chriseth okay i can recrete this behaviour in solcjs. I just think that current state of things is wrong.

krzkaczor avatar Nov 13 '18 14:11 krzkaczor

@krzkaczor it would be appreciated. Please also rebase :)

axic avatar Nov 13 '18 15:11 axic

Hi, I believe we can have this. And maybe add a --overwrite flag like the one in solc to prevent the name collisions? So the behavior of solc-js and solc would be compatible. What do you think @chriseth?

@krzkaczor would you like to finish this, or should we take it over?

r0qs avatar Sep 27 '22 19:09 r0qs

@r0qs please, take over :)

krzkaczor avatar Sep 28 '22 07:09 krzkaczor