Skip to content

Commit 5a695c2

Browse files
committed
Add notes for payable function calls.
1 parent 466e94f commit 5a695c2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
This is the complete reference implementation of the [ERC-721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md) non-fungible token standard for the Ethereum and Wanchain blockchains. This is an open-source project, complete with [Hardhat](https://hardhat.org/) testing.
66

77
The purpose of this implementation is to provide a good starting point for anyone who wants to use and develop non-fungible tokens on the Ethereum and Wanchain blockchains. Instead of re-implementing the ERC-721 yourself you can use this code which has gone through multiple audits and we hope it will be extensively used by the community in the future.
8+
Note that this implementation is more restrictive then the ERC-721 standard since it does not support `payable` function calls out of the box. You are however free to add this yourself.
89

910
If you are looking for a more feature-rich and advanced ERC721 implementation, then check out the [0xcert Framework](https://github.com/0xcert/framework).
1011

src/contracts/tokens/erc721.sol

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ interface ERC721
4848
* function checks if `_to` is a smart contract (code size > 0). If so, it calls
4949
* `onERC721Received` on `_to` and throws if the return value is not
5050
* `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`.
51-
* @dev Transfers the ownership of an NFT from one address to another address.
51+
* @dev Transfers the ownership of an NFT from one address to another address. This function can
52+
* be changed to payable.
5253
* @param _from The current owner of the NFT.
5354
* @param _to The new owner.
5455
* @param _tokenId The NFT to transfer.
@@ -65,7 +66,8 @@ interface ERC721
6566
/**
6667
* @notice This works identically to the other function with an extra data parameter, except this
6768
* function just sets data to ""
68-
* @dev Transfers the ownership of an NFT from one address to another address.
69+
* @dev Transfers the ownership of an NFT from one address to another address. This function can
70+
* be changed to payable.
6971
* @param _from The current owner of the NFT.
7072
* @param _to The new owner.
7173
* @param _tokenId The NFT to transfer.
@@ -82,7 +84,7 @@ interface ERC721
8284
* they may be permanently lost.
8385
* @dev Throws unless `msg.sender` is the current owner, an authorized operator, or the approved
8486
* address for this NFT. Throws if `_from` is not the current owner. Throws if `_to` is the zero
85-
* address. Throws if `_tokenId` is not a valid NFT.
87+
* address. Throws if `_tokenId` is not a valid NFT. This function can be changed to payable.
8688
* @param _from The current owner of the NFT.
8789
* @param _to The new owner.
8890
* @param _tokenId The NFT to transfer.
@@ -98,7 +100,7 @@ interface ERC721
98100
* @notice The zero address indicates there is no approved address. Throws unless `msg.sender` is
99101
* the current NFT owner, or an authorized operator of the current owner.
100102
* @param _approved The new approved NFT controller.
101-
* @dev Set or reaffirm the approved address for an NFT.
103+
* @dev Set or reaffirm the approved address for an NFT. This function can be changed to payable.
102104
* @param _tokenId The NFT to approve.
103105
*/
104106
function approve(

0 commit comments

Comments
 (0)