-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPDX: Multiple licenses in same file #8989
Comments
Some potential answers:
Basically what this means is that projects should have already been aware what is the license of the final product if they use sources with different licenses. Now they have to choose an appropriate SPDX setting based on this knowledge. |
Thank you, that sounds reasonable. What do you think about removing the compiler error when the multiple SPDX comments found contain exactly the same identifier? |
I think it still makes sense error out on having multiple identical identifiers, if the only realistic case this is happening is after "flattening". |
I agree with what @axic says. Note that flattening modifies the source code, which might already be illegal depending on the license. |
Flattening appears to be the only issue. Discussion in OpenZeppelin Community Forum: https://forum.openzeppelin.com/t/solidity-0-6-8-introduces-spdx-license-identifiers/2859 |
because of this errors plugins like https://github.com/rkalis/truffle-plugin-verify can't simply be use without some sort of workaround. You also can't simple upload many files on etherscan if you use lots of libs from oz. Wouldn't be better to emit a warning instead of an error? |
Before the feature so called "license" is introduced, everything was smooth. Flattening file helps developers a lot. Why not allow multiple licenses in a single file? |
The license is not the only problem:
All the languages like go, js and Solidity have a proper module system that defines namespaces. If you flatten everything, names can clash and it just gets messy. If you are concerned about the usability of etherscan, please talk to them so that the provide a convenient multi-file download with a standard-json or metadata structure. You can also use sourcify, if you want: Navigate to
and press the arrow button on the top left to download. The |
Most of the time in solidity, flattening works.
Thanks anyway. But it is undeniable that using flatten is still more easier for reading code or verifying source code My thinking is that you should not restrict non-technical thing. E.g:
|
Flattening entire source trees into a single file is very common practice as it's an easy way of verifying contract source code. This causes a few issues with the new SPDX comments.
Is it possible at least to remove the compiler error if multiple equal SPDX comments are found?
The text was updated successfully, but these errors were encountered: