diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index ff0f16e5e..a2fc4e324 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -2,23 +2,29 @@ pragma solidity ^0.4.18; import "./ERC721Basic.sol"; -/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension -/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md +/** + * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension + * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md + */ contract ERC721Enumerable is ERC721Basic { function totalSupply() public view returns (uint256); function tokenOfOwnerByIndex(address _owner, uint256 _index) public view returns (uint256 _tokenId); function tokenByIndex(uint256 _index) public view returns (uint256); } -/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension -/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md +/** + * @title ERC-721 Non-Fungible Token Standard, optional metadata extension + * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md + */ contract ERC721Metadata is ERC721Basic { function name() public view returns (string _name); function symbol() public view returns (string _symbol); function tokenURI(uint256 _tokenId) public view returns (string); } -/// @title ERC-721 Non-Fungible Token Standard, full implementation interface -/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md +/** + * @title ERC-721 Non-Fungible Token Standard, full implementation interface + * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md + */ contract ERC721 is ERC721Basic, ERC721Enumerable, ERC721Metadata { } diff --git a/contracts/token/ERC721/ERC721Receiver.sol b/contracts/token/ERC721/ERC721Receiver.sol index d47ce73c3..15a4138f4 100644 --- a/contracts/token/ERC721/ERC721Receiver.sol +++ b/contracts/token/ERC721/ERC721Receiver.sol @@ -1,19 +1,28 @@ pragma solidity ^0.4.18; +/** + * @title ERC721 token receiver interface + * @dev Interface for any contract that wants to support safeTransfers + * from ERC721 asset contracts. + */ contract ERC721Receiver { - /// @dev Magic value to be returned upon successful reception of an NFT - /// Equals to bytes4(keccak256("onERC721Received(address,uint256,bytes)")) + /** + * @dev Magic value to be returned upon successful reception of an NFT + * Equals to bytes4(keccak256("onERC721Received(address,uint256,bytes)")) + */ bytes4 ERC721_RECEIVED = 0xf0b9e5ba; - /// @notice Handle the receipt of an NFT - /// @dev The ERC721 smart contract calls this function on the recipient - /// after a `safetransfer`. This function MAY throw to revert and reject the - /// transfer. This function MUST use 50,000 gas or less. Return of other - /// than the magic value MUST result in the transaction being reverted. - /// Note: the contract address is always the message sender. - /// @param _from The sending address - /// @param _tokenId The NFT identifier which is being transfered - /// @param _data Additional data with no specified format - /// @return `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))` + /** + * @notice Handle the receipt of an NFT + * @dev The ERC721 smart contract calls this function on the recipient + * after a `safetransfer`. This function MAY throw to revert and reject the + * transfer. This function MUST use 50,000 gas or less. Return of other + * than the magic value MUST result in the transaction being reverted. + * Note: the contract address is always the message sender. + * @param _from The sending address + * @param _tokenId The NFT identifier which is being transfered + * @param _data Additional data with no specified format + * @return `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))` + */ function onERC721Received(address _from, uint256 _tokenId, bytes _data) public returns(bytes4); }