diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7536d82881f..07747754d7c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -253,11 +253,12 @@ examples-fmt: <<: *docker-env <<: *test-refs script: + # Note that we disable the license header check for the examples, since they are unlicensed. - for example in examples/*/; do - cargo fmt --verbose --manifest-path ${example}/Cargo.toml -- --check; + cargo fmt --verbose --manifest-path ${example}/Cargo.toml -- --check --config=license_template_path=""; done - for contract in ${DELEGATOR_SUBCONTRACTS}; do - cargo fmt --verbose --manifest-path examples/delegator/${contract}/Cargo.toml -- --check; + cargo fmt --verbose --manifest-path examples/delegator/${contract}/Cargo.toml -- --check --config=license_template_path=""; done examples-clippy-std: diff --git a/examples/LICENSE b/examples/LICENSE new file mode 100644 index 00000000000..cf1ab25da03 --- /dev/null +++ b/examples/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/examples/README.md b/examples/README.md index 8cab0327d39..73cb874ae06 100644 --- a/examples/README.md +++ b/examples/README.md @@ -25,4 +25,7 @@ The `.contract` file combines the Wasm and metadata into one file and can be use ## License -The entire code within this repository is licensed under the [GPL v3](LICENSE). Please [contact us](https://www.parity.io/contact/) if you have questions about the licensing of our products. +The examples in this folder are released into the public domain. +We hope they help you build something great with ink!. + +See the [LICENSE file](LICENSE) in this folder for more details. diff --git a/examples/contract-terminate/lib.rs b/examples/contract-terminate/lib.rs index e077a9d426e..86a51094e52 100644 --- a/examples/contract-terminate/lib.rs +++ b/examples/contract-terminate/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2018-2021 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - //! A smart contract which demonstrates behavior of the `self.env().terminate()` //! function. It terminates itself once `terminate_me()` is called. diff --git a/examples/contract-transfer/lib.rs b/examples/contract-transfer/lib.rs index ced581e8468..f42e55a54a1 100644 --- a/examples/contract-transfer/lib.rs +++ b/examples/contract-transfer/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2018-2021 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - //! A smart contract which demonstrates behavior of the `self.env().transfer()` function. //! It transfers some of it's balance to the caller. diff --git a/examples/delegator/accumulator/lib.rs b/examples/delegator/accumulator/lib.rs index 74ee6efd5e1..8fd207c4a8d 100644 --- a/examples/delegator/accumulator/lib.rs +++ b/examples/delegator/accumulator/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2018-2021 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #![cfg_attr(not(feature = "std"), no_std)] pub use self::accumulator::Accumulator; diff --git a/examples/delegator/adder/lib.rs b/examples/delegator/adder/lib.rs index 128372c258e..91af1fd12f7 100644 --- a/examples/delegator/adder/lib.rs +++ b/examples/delegator/adder/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2018-2021 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #![cfg_attr(not(feature = "std"), no_std)] pub use self::adder::Adder; diff --git a/examples/delegator/lib.rs b/examples/delegator/lib.rs index ead0c377263..5fa7e0fbd8b 100644 --- a/examples/delegator/lib.rs +++ b/examples/delegator/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2018-2021 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #![cfg_attr(not(feature = "std"), no_std)] use ink_lang as ink; diff --git a/examples/delegator/subber/lib.rs b/examples/delegator/subber/lib.rs index 0043ff726a2..30d5424c776 100644 --- a/examples/delegator/subber/lib.rs +++ b/examples/delegator/subber/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2018-2021 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #![cfg_attr(not(feature = "std"), no_std)] pub use self::subber::Subber; diff --git a/examples/dns/lib.rs b/examples/dns/lib.rs index a59aa704e7e..bbbb8d443a1 100644 --- a/examples/dns/lib.rs +++ b/examples/dns/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2018-2021 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #![cfg_attr(not(feature = "std"), no_std)] use ink_lang as ink; diff --git a/examples/erc1155/lib.rs b/examples/erc1155/lib.rs index 55d42dcaf36..67ac9d2d558 100644 --- a/examples/erc1155/lib.rs +++ b/examples/erc1155/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2018-2021 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #![cfg_attr(not(feature = "std"), no_std)] use ink_env::AccountId; diff --git a/examples/erc20/lib.rs b/examples/erc20/lib.rs index 1e36b51d5bf..755be1d6bbf 100644 --- a/examples/erc20/lib.rs +++ b/examples/erc20/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2018-2021 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #![cfg_attr(not(feature = "std"), no_std)] use ink_lang as ink; diff --git a/examples/erc721/lib.rs b/examples/erc721/lib.rs index 66f6a0d8df9..9db960a47b0 100644 --- a/examples/erc721/lib.rs +++ b/examples/erc721/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2018-2021 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - //! # ERC-721 //! //! This is an ERC-721 Token implementation. diff --git a/examples/flipper/lib.rs b/examples/flipper/lib.rs index 7f2e76eaab3..ec8c3026533 100644 --- a/examples/flipper/lib.rs +++ b/examples/flipper/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2018-2021 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #![cfg_attr(not(feature = "std"), no_std)] use ink_lang as ink; diff --git a/examples/incrementer/lib.rs b/examples/incrementer/lib.rs index cacb5e7c0b2..05e88494379 100644 --- a/examples/incrementer/lib.rs +++ b/examples/incrementer/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2018-2021 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #![cfg_attr(not(feature = "std"), no_std)] use ink_lang as ink; diff --git a/examples/multisig_plain/lib.rs b/examples/multisig_plain/lib.rs index 08c28f89086..20570a45ffe 100755 --- a/examples/multisig_plain/lib.rs +++ b/examples/multisig_plain/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2018-2021 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - //! # Plain Multisig Wallet //! //! This implements a plain multi owner wallet. diff --git a/examples/rand-extension/lib.rs b/examples/rand-extension/lib.rs index 3ee7dd65792..d6033fd82f8 100755 --- a/examples/rand-extension/lib.rs +++ b/examples/rand-extension/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2018-2021 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #![cfg_attr(not(feature = "std"), no_std)] use ink_env::Environment; diff --git a/examples/trait-erc20/lib.rs b/examples/trait-erc20/lib.rs index 5be934e19a4..a7a737dc436 100644 --- a/examples/trait-erc20/lib.rs +++ b/examples/trait-erc20/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2018-2021 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #![cfg_attr(not(feature = "std"), no_std)] use ink_lang as ink; diff --git a/examples/trait-flipper/lib.rs b/examples/trait-flipper/lib.rs index 5e9dee0f05e..8bc0347b30d 100644 --- a/examples/trait-flipper/lib.rs +++ b/examples/trait-flipper/lib.rs @@ -1,17 +1,3 @@ -// Copyright 2018-2021 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #![cfg_attr(not(feature = "std"), no_std)] use ink_lang as ink;