Skip to content

Commit

Permalink
Documentation changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed May 13, 2020
1 parent 5951c2f commit b98a695
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
34 changes: 34 additions & 0 deletions docs/layout-of-source-files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,40 @@ Source files can contain an arbitrary number of
:ref:`pragma directives<pragma>` and
:ref:`struct<structs>` and :ref:`enum<enums>` definitions.

.. index:: ! license, spdx

SPDX License Identifier
=======================

Trust in smart contract can be better established if their source code
is available. Since making source code available always touches on legal problems
with regards to copyright, the Solidity compiler encouranges the use
of machine-readable `SPDX license identifiers <https://spdx.org>`_.
Every source file should start with a comment indicating its license:

::

// SPDX-License-Identifier: MIT

The compiler does not validate that the license is part of the
`list allowed by SPDX <https://spdx.org/licenses/>`_, but
it does include the supplied string in the `bytecode metadata <metadata>`_.

If you do not want to specify a license or if the source code is
not open-source, please use the special value ``UNLICENSED``.

Supplying this comment of course does not free you from other
obligations related to licensing like having to mention
a specific license header in each source file or the
original copyrigh holder.

The comment is recognized by the compiler anywhere in the file at the
file level, but it is recommended to put it at the top of the file.

More information about how to use SPDX license identifiers
can be found at the `SPDX website <https://spdx.org/ids-how>`_.


.. index:: ! pragma

.. _pragma:
Expand Down
6 changes: 5 additions & 1 deletion docs/metadata.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _metadata:

#################
Contract Metadata
#################
Expand Down Expand Up @@ -54,7 +56,9 @@ explanatory purposes.
// Required (unless "content" is used, see below): Sorted URL(s)
// to the source file, protocol is more or less arbitrary, but a
// Swarm URL is recommended
"urls": [ "bzzr://56ab..." ]
"urls": [ "bzzr://56ab..." ],
// Optional: SPDX license identifier as given in the source file
"license": "MIT"
},
"destructible": {
// Required: keccak256 hash of the source file
Expand Down

0 comments on commit b98a695

Please sign in to comment.