diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-07-27 07:19:10 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-08-17 08:31:21 +0800 |
commit | 0f3201d72a181c3dc7bafba9a82c141f91463ce9 (patch) | |
tree | 16e1c151b08b874a66eeed63f40cd044825445df /packages/contracts/src/2.0.0/test | |
parent | 8131a87046e129f6f5a8978e6133fb21abd8db42 (diff) | |
download | dexon-sol-tools-0f3201d72a181c3dc7bafba9a82c141f91463ce9.tar.gz dexon-sol-tools-0f3201d72a181c3dc7bafba9a82c141f91463ce9.tar.zst dexon-sol-tools-0f3201d72a181c3dc7bafba9a82c141f91463ce9.zip |
Optimize ERC721Token
Diffstat (limited to 'packages/contracts/src/2.0.0/test')
-rw-r--r-- | packages/contracts/src/2.0.0/test/DummyERC721Token/DummyERC721Token.sol | 56 |
1 files changed, 16 insertions, 40 deletions
diff --git a/packages/contracts/src/2.0.0/test/DummyERC721Token/DummyERC721Token.sol b/packages/contracts/src/2.0.0/test/DummyERC721Token/DummyERC721Token.sol index 627746a52..7c64005bd 100644 --- a/packages/contracts/src/2.0.0/test/DummyERC721Token/DummyERC721Token.sol +++ b/packages/contracts/src/2.0.0/test/DummyERC721Token/DummyERC721Token.sol @@ -18,59 +18,35 @@ pragma solidity 0.4.24; -import "../../tokens/ERC721Token/ERC721Token.sol"; +import "../../tokens/ERC721Token/MintableERC721Token.sol"; import "../../utils/Ownable/Ownable.sol"; // solhint-disable no-empty-blocks contract DummyERC721Token is Ownable, - ERC721Token + MintableERC721Token { - /** - * @dev Constructor passes its arguments to the base ERC721Token constructor - * @param name of token - * @param symbol of token - */ - constructor ( - string name, - string symbol - ) - public - ERC721Token(name, symbol) - {} - - /** - * @dev Function to mint a new token - * @dev Reverts if the given token ID already exists - * @param to address the beneficiary that will own the minted token - * @param tokenId uint256 ID of the token to be minted by the msg.sender - */ - function mint(address to, uint256 tokenId) - public + /// @dev Function to mint a new token + /// Reverts if the given token ID already exists + /// @param _to Address of the beneficiary that will own the minted token + /// @param _tokenId ID of the token to be minted by the msg.sender + function mint(address _to, uint256 _tokenId) + external onlyOwner { - require( - !exists(tokenId), - "Token with tokenId already exists." - ); - _mint(to, tokenId); + _mint(_to, _tokenId); } - /** - * @dev Function to burn a token - * @dev Reverts if the given token ID doesn't exist - * @param tokenId uint256 ID of the token to be minted by the msg.sender - */ - function burn(address owner, uint256 tokenId) - public + /// @dev Function to burn a token + /// Reverts if the given token ID doesn't exist + /// @param _owner Owner of token with given token ID + /// @param _tokenId ID of the token to be burned by the msg.sender + function burn(address _owner, uint256 _tokenId) + external onlyOwner { - require( - exists(tokenId), - "Token with tokenId does not exist." - ); - _burn(owner, tokenId); + _burn(_owner, _tokenId); } } |