From b334218f855ae94285afe271a770f1f29d20b7df Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Wed, 22 Nov 2023 22:57:30 -0500 Subject: [PATCH] docs: add warnings at the top of all example token contracts (#3676) discourage people from using them in production --- examples/crowdfund.vy | 6 +++++- examples/tokens/ERC1155ownable.vy | 7 ++++++- examples/tokens/ERC20.vy | 6 +++++- examples/tokens/ERC4626.vy | 7 +++++++ examples/tokens/ERC721.vy | 6 +++++- examples/wallet/wallet.vy | 7 +++++-- 6 files changed, 33 insertions(+), 6 deletions(-) diff --git a/examples/crowdfund.vy b/examples/crowdfund.vy index 56b34308f1..6d07e15bc4 100644 --- a/examples/crowdfund.vy +++ b/examples/crowdfund.vy @@ -1,4 +1,8 @@ -# Setup private variables (only callable from within the contract) +########################################################################### +## THIS IS EXAMPLE CODE, NOT MEANT TO BE USED IN PRODUCTION! CAVEAT EMPTOR! +########################################################################### + +# example of a crowd funding contract funders: HashMap[address, uint256] beneficiary: address diff --git a/examples/tokens/ERC1155ownable.vy b/examples/tokens/ERC1155ownable.vy index f1070b8f89..30057582e8 100644 --- a/examples/tokens/ERC1155ownable.vy +++ b/examples/tokens/ERC1155ownable.vy @@ -1,8 +1,13 @@ +########################################################################### +## THIS IS EXAMPLE CODE, NOT MEANT TO BE USED IN PRODUCTION! CAVEAT EMPTOR! +########################################################################### + # @version >=0.3.4 """ -@dev Implementation of ERC-1155 non-fungible token standard ownable, with approval, OPENSEA compatible (name, symbol) +@dev example implementation of ERC-1155 non-fungible token standard ownable, with approval, OPENSEA compatible (name, symbol) @author Dr. Pixel (github: @Doc-Pixel) """ + ############### imports ############### from vyper.interfaces import ERC165 diff --git a/examples/tokens/ERC20.vy b/examples/tokens/ERC20.vy index 4c1d334691..c3809dbb60 100644 --- a/examples/tokens/ERC20.vy +++ b/examples/tokens/ERC20.vy @@ -1,4 +1,8 @@ -# @dev Implementation of ERC-20 token standard. +########################################################################### +## THIS IS EXAMPLE CODE, NOT MEANT TO BE USED IN PRODUCTION! CAVEAT EMPTOR! +########################################################################### + +# @dev example implementation of an ERC20 token # @author Takayuki Jimba (@yudetamago) # https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md diff --git a/examples/tokens/ERC4626.vy b/examples/tokens/ERC4626.vy index a9cbcc86c8..0a0a698bf0 100644 --- a/examples/tokens/ERC4626.vy +++ b/examples/tokens/ERC4626.vy @@ -1,4 +1,11 @@ # NOTE: Copied from https://github.com/fubuloubu/ERC4626/blob/1a10b051928b11eeaad15d80397ed36603c2a49b/contracts/VyperVault.vy + +# example implementation of an ERC4626 vault + +########################################################################### +## THIS IS EXAMPLE CODE, NOT MEANT TO BE USED IN PRODUCTION! CAVEAT EMPTOR! +########################################################################### + from vyper.interfaces import ERC20 from vyper.interfaces import ERC4626 diff --git a/examples/tokens/ERC721.vy b/examples/tokens/ERC721.vy index 5125040399..152b94b046 100644 --- a/examples/tokens/ERC721.vy +++ b/examples/tokens/ERC721.vy @@ -1,4 +1,8 @@ -# @dev Implementation of ERC-721 non-fungible token standard. +########################################################################### +## THIS IS EXAMPLE CODE, NOT MEANT TO BE USED IN PRODUCTION! CAVEAT EMPTOR! +########################################################################### + +# @dev example implementation of ERC-721 non-fungible token standard. # @author Ryuya Nakamura (@nrryuya) # Modified from: https://github.com/vyperlang/vyper/blob/de74722bf2d8718cca46902be165f9fe0e3641dd/examples/tokens/ERC721.vy diff --git a/examples/wallet/wallet.vy b/examples/wallet/wallet.vy index 5fd5229136..e2515d9e62 100644 --- a/examples/wallet/wallet.vy +++ b/examples/wallet/wallet.vy @@ -1,5 +1,8 @@ -# An example of how you can do a wallet in Vyper. -# Warning: NOT AUDITED. Do not use to store substantial quantities of funds. +########################################################################### +## THIS IS EXAMPLE CODE, NOT MEANT TO BE USED IN PRODUCTION! CAVEAT EMPTOR! +########################################################################### + +# An example of how you can implement a wallet in Vyper. # A list of the owners addresses (there are a maximum of 5 owners) owners: public(address[5])