solidity-flattener icon indicating copy to clipboard operation
solidity-flattener copied to clipboard

Solidity version is ^0.4.13 (hard coded)

Open bajayo opened this issue 8 years ago • 7 comments

Though it's a non issue, as it's very easy to replace that single line, still wanted to add this issue so people are aware of it.

bajayo avatar Sep 24 '17 13:09 bajayo

Definitely an issue. I hadn't yet figured out how best to derive and insert the solidity version dynamically - if you have any suggestions for that I'd love to add it in as a feature!

Stickerpants avatar Oct 03 '17 18:10 Stickerpants

IMO it should throw an error if different input files use different pragma versions.

Sjors avatar Nov 14 '17 12:11 Sjors

I can see an argument for both sides of that.

On one hand, mismatched versioned files implies that care ought to be taken to ensure code compatibility across different versions.

On the other, it'd be poor usability to have to doctor several files for their pragma line in order to get it to run successfully.

How about a warning by default, with an optional flag to force it to error instead?

Thoughts appreciated!

Stickerpants avatar Nov 16 '17 19:11 Stickerpants

How about a warning by default, with an optional flag to force it to error instead?

That could make sense too.

Sjors avatar Nov 17 '17 07:11 Sjors

I think, what version string needs to be put in the flattened file, that string should be made configurable. solidity_flattener -v "0.4.18" SmartContract.sol

This is how it should take parameter.

jchittoda avatar Jan 30 '18 12:01 jchittoda

Yes, that's a reasonable middle-ground. I'll take it into consideration. Thank you @jchittoda!

Stickerpants avatar Jan 30 '18 20:01 Stickerpants

Lol, I was just wondering where this 0.4.13 is coming from...

I first used truffle-flattener but ran into verification issues. They are open about that on their README and referenced this project

But checkout the breaking changes with solc 0.5: https://solidity.readthedocs.io/en/v0.5.2/050-breaking-changes.html#interoperability-with-older-contracts -> Does this hardcoded pragma even work nowadays with solc v0.5+?

JohannesMayerConda avatar Jan 09 '19 17:01 JohannesMayerConda