-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1 parent
a5ace25
commit 6a0f55a
Showing
131 changed files
with
7,262 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
contracts/mutants/ERC721GSNRecipientMock/1/CCD/ERC721GSNRecipientMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "../token/ERC721/ERC721.sol"; | ||
import "../GSN/GSNRecipient.sol"; | ||
import "../GSN/GSNRecipientSignature.sol"; | ||
|
||
/** | ||
* @title ERC721GSNRecipientMock | ||
* A simple ERC721 mock that has GSN support enabled | ||
*/ | ||
contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature { | ||
|
||
|
||
function mint(uint256 tokenId) public { | ||
_mint(_msgSender(), tokenId); | ||
} | ||
|
||
function _msgSender() internal view override(Context, GSNRecipient) returns (address payable) { | ||
return GSNRecipient._msgSender(); | ||
} | ||
|
||
function _msgData() internal view override(Context, GSNRecipient) returns (bytes memory) { | ||
return GSNRecipient._msgData(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
contracts/mutants/ERC721GSNRecipientMock/1/DLR/ERC721GSNRecipientMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "../token/ERC721/ERC721.sol"; | ||
import "../GSN/GSNRecipient.sol"; | ||
import "../GSN/GSNRecipientSignature.sol"; | ||
|
||
/** | ||
* @title ERC721GSNRecipientMock | ||
* A simple ERC721 mock that has GSN support enabled | ||
*/ | ||
contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature { | ||
constructor(string storage name, string memory symbol, address trustedSigner) | ||
public | ||
ERC721(name, symbol) | ||
GSNRecipientSignature(trustedSigner) | ||
{ } | ||
|
||
function mint(uint256 tokenId) public { | ||
_mint(_msgSender(), tokenId); | ||
} | ||
|
||
function _msgSender() internal view override(Context, GSNRecipient) returns (address payable) { | ||
return GSNRecipient._msgSender(); | ||
} | ||
|
||
function _msgData() internal view override(Context, GSNRecipient) returns (bytes memory) { | ||
return GSNRecipient._msgData(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
contracts/mutants/ERC721GSNRecipientMock/1/FVR/ERC721GSNRecipientMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "../token/ERC721/ERC721.sol"; | ||
import "../GSN/GSNRecipient.sol"; | ||
import "../GSN/GSNRecipientSignature.sol"; | ||
|
||
/** | ||
* @title ERC721GSNRecipientMock | ||
* A simple ERC721 mock that has GSN support enabled | ||
*/ | ||
contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature { | ||
constructor(string memory name, string memory symbol, address trustedSigner) | ||
internal | ||
ERC721(name, symbol) | ||
GSNRecipientSignature(trustedSigner) | ||
{ } | ||
|
||
function mint(uint256 tokenId) public { | ||
_mint(_msgSender(), tokenId); | ||
} | ||
|
||
function _msgSender() internal view override(Context, GSNRecipient) returns (address payable) { | ||
return GSNRecipient._msgSender(); | ||
} | ||
|
||
function _msgData() internal view override(Context, GSNRecipient) returns (bytes memory) { | ||
return GSNRecipient._msgData(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
contracts/mutants/ERC721GSNRecipientMock/1/MOC/ERC721GSNRecipientMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "../token/ERC721/ERC721.sol"; | ||
import "../GSN/GSNRecipient.sol"; | ||
import "../GSN/GSNRecipientSignature.sol"; | ||
|
||
/** | ||
* @title ERC721GSNRecipientMock | ||
* A simple ERC721 mock that has GSN support enabled | ||
*/ | ||
contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature { | ||
constructor(string memory name, string memory symbol, address trustedSigner) | ||
public | ||
GSNRecipientSignature(trustedSigner) | ||
ERC721(name, symbol) | ||
{ } | ||
|
||
function mint(uint256 tokenId) public { | ||
_mint(_msgSender(), tokenId); | ||
} | ||
|
||
function _msgSender() internal view override(Context, GSNRecipient) returns (address payable) { | ||
return GSNRecipient._msgSender(); | ||
} | ||
|
||
function _msgData() internal view override(Context, GSNRecipient) returns (bytes memory) { | ||
return GSNRecipient._msgData(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
contracts/mutants/ERC721GSNRecipientMock/1/MOD/ERC721GSNRecipientMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "../token/ERC721/ERC721.sol"; | ||
import "../GSN/GSNRecipient.sol"; | ||
import "../GSN/GSNRecipientSignature.sol"; | ||
|
||
/** | ||
* @title ERC721GSNRecipientMock | ||
* A simple ERC721 mock that has GSN support enabled | ||
*/ | ||
contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature { | ||
constructor(string memory name, string memory symbol, address trustedSigner) | ||
public | ||
GSNRecipientSignature(trustedSigner) | ||
ERC721(name, symbol) | ||
{ } | ||
|
||
function mint(uint256 tokenId) public { | ||
_mint(_msgSender(), tokenId); | ||
} | ||
|
||
function _msgSender() internal view override(Context, GSNRecipient) returns (address payable) { | ||
return GSNRecipient._msgSender(); | ||
} | ||
|
||
function _msgData() internal view override(Context, GSNRecipient) returns (bytes memory) { | ||
return GSNRecipient._msgData(); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
contracts/mutants/ERC721GSNRecipientMock/1/ORFD/ERC721GSNRecipientMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "../token/ERC721/ERC721.sol"; | ||
import "../GSN/GSNRecipient.sol"; | ||
import "../GSN/GSNRecipientSignature.sol"; | ||
|
||
/** | ||
* @title ERC721GSNRecipientMock | ||
* A simple ERC721 mock that has GSN support enabled | ||
*/ | ||
contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature { | ||
constructor(string memory name, string memory symbol, address trustedSigner) | ||
public | ||
ERC721(name, symbol) | ||
GSNRecipientSignature(trustedSigner) | ||
{ } | ||
|
||
function mint(uint256 tokenId) public { | ||
_mint(_msgSender(), tokenId); | ||
} | ||
|
||
|
||
|
||
function _msgData() internal view override(Context, GSNRecipient) returns (bytes memory) { | ||
return GSNRecipient._msgData(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
contracts/mutants/ERC721GSNRecipientMock/1/RSD/ERC721GSNRecipientMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "../token/ERC721/ERC721.sol"; | ||
import "../GSN/GSNRecipient.sol"; | ||
import "../GSN/GSNRecipientSignature.sol"; | ||
|
||
/** | ||
* @title ERC721GSNRecipientMock | ||
* A simple ERC721 mock that has GSN support enabled | ||
*/ | ||
contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature { | ||
constructor(string memory name, string memory symbol, address trustedSigner) | ||
public | ||
ERC721(name, symbol) | ||
GSNRecipientSignature(trustedSigner) | ||
{ } | ||
|
||
function mint(uint256 tokenId) public { | ||
_mint(_msgSender(), tokenId); | ||
} | ||
|
||
function _msgSender() internal view override(Context, GSNRecipient) returns (address payable) { | ||
/* return GSNRecipient._msgSender(); */ | ||
} | ||
|
||
function _msgData() internal view override(Context, GSNRecipient) returns (bytes memory) { | ||
return GSNRecipient._msgData(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
contracts/mutants/ERC721GSNRecipientMock/1/SKI/ERC721GSNRecipientMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "../token/ERC721/ERC721.sol"; | ||
import "../GSN/GSNRecipient.sol"; | ||
import "../GSN/GSNRecipientSignature.sol"; | ||
|
||
/** | ||
* @title ERC721GSNRecipientMock | ||
* A simple ERC721 mock that has GSN support enabled | ||
*/ | ||
contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature { | ||
constructor(string memory name, string memory symbol, address trustedSigner) | ||
public | ||
ERC721(name, symbol) | ||
GSNRecipientSignature(trustedSigner) | ||
{ } | ||
|
||
function mint(uint256 tokenId) public { | ||
_mint(super._msgSender(), tokenId); | ||
} | ||
|
||
function _msgSender() internal view override(Context, GSNRecipient) returns (address payable) { | ||
return GSNRecipient._msgSender(); | ||
} | ||
|
||
function _msgData() internal view override(Context, GSNRecipient) returns (bytes memory) { | ||
return GSNRecipient._msgData(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
contracts/mutants/ERC721GSNRecipientMock/2/DLR/ERC721GSNRecipientMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "../token/ERC721/ERC721.sol"; | ||
import "../GSN/GSNRecipient.sol"; | ||
import "../GSN/GSNRecipientSignature.sol"; | ||
|
||
/** | ||
* @title ERC721GSNRecipientMock | ||
* A simple ERC721 mock that has GSN support enabled | ||
*/ | ||
contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature { | ||
constructor(string storage name, string storage symbol, address trustedSigner) | ||
public | ||
ERC721(name, symbol) | ||
GSNRecipientSignature(trustedSigner) | ||
{ } | ||
|
||
function mint(uint256 tokenId) public { | ||
_mint(_msgSender(), tokenId); | ||
} | ||
|
||
function _msgSender() internal view override(Context, GSNRecipient) returns (address payable) { | ||
return GSNRecipient._msgSender(); | ||
} | ||
|
||
function _msgData() internal view override(Context, GSNRecipient) returns (bytes memory) { | ||
return GSNRecipient._msgData(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
contracts/mutants/ERC721GSNRecipientMock/2/FVR/ERC721GSNRecipientMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "../token/ERC721/ERC721.sol"; | ||
import "../GSN/GSNRecipient.sol"; | ||
import "../GSN/GSNRecipientSignature.sol"; | ||
|
||
/** | ||
* @title ERC721GSNRecipientMock | ||
* A simple ERC721 mock that has GSN support enabled | ||
*/ | ||
contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature { | ||
constructor(string memory name, string memory symbol, address trustedSigner) | ||
internal | ||
ERC721(name, symbol) | ||
GSNRecipientSignature(trustedSigner) | ||
{ } | ||
|
||
function mint(uint256 tokenId) external { | ||
_mint(_msgSender(), tokenId); | ||
} | ||
|
||
function _msgSender() internal view override(Context, GSNRecipient) returns (address payable) { | ||
return GSNRecipient._msgSender(); | ||
} | ||
|
||
function _msgData() internal view override(Context, GSNRecipient) returns (bytes memory) { | ||
return GSNRecipient._msgData(); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
contracts/mutants/ERC721GSNRecipientMock/2/ORFD/ERC721GSNRecipientMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "../token/ERC721/ERC721.sol"; | ||
import "../GSN/GSNRecipient.sol"; | ||
import "../GSN/GSNRecipientSignature.sol"; | ||
|
||
/** | ||
* @title ERC721GSNRecipientMock | ||
* A simple ERC721 mock that has GSN support enabled | ||
*/ | ||
contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature { | ||
constructor(string memory name, string memory symbol, address trustedSigner) | ||
public | ||
ERC721(name, symbol) | ||
GSNRecipientSignature(trustedSigner) | ||
{ } | ||
|
||
function mint(uint256 tokenId) public { | ||
_mint(_msgSender(), tokenId); | ||
} | ||
|
||
|
||
|
||
|
||
} |
31 changes: 31 additions & 0 deletions
31
contracts/mutants/ERC721GSNRecipientMock/2/RSD/ERC721GSNRecipientMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "../token/ERC721/ERC721.sol"; | ||
import "../GSN/GSNRecipient.sol"; | ||
import "../GSN/GSNRecipientSignature.sol"; | ||
|
||
/** | ||
* @title ERC721GSNRecipientMock | ||
* A simple ERC721 mock that has GSN support enabled | ||
*/ | ||
contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature { | ||
constructor(string memory name, string memory symbol, address trustedSigner) | ||
public | ||
ERC721(name, symbol) | ||
GSNRecipientSignature(trustedSigner) | ||
{ } | ||
|
||
function mint(uint256 tokenId) public { | ||
_mint(_msgSender(), tokenId); | ||
} | ||
|
||
function _msgSender() internal view override(Context, GSNRecipient) returns (address payable) { | ||
/* return GSNRecipient._msgSender(); */ | ||
} | ||
|
||
function _msgData() internal view override(Context, GSNRecipient) returns (bytes memory) { | ||
/* return GSNRecipient._msgData(); */ | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
contracts/mutants/ERC721GSNRecipientMock/3/DLR/ERC721GSNRecipientMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "../token/ERC721/ERC721.sol"; | ||
import "../GSN/GSNRecipient.sol"; | ||
import "../GSN/GSNRecipientSignature.sol"; | ||
|
||
/** | ||
* @title ERC721GSNRecipientMock | ||
* A simple ERC721 mock that has GSN support enabled | ||
*/ | ||
contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature { | ||
constructor(string storage name, string storage symbol, address trustedSigner) | ||
public | ||
ERC721(name, symbol) | ||
GSNRecipientSignature(trustedSigner) | ||
{ } | ||
|
||
function mint(uint256 tokenId) public { | ||
_mint(_msgSender(), tokenId); | ||
} | ||
|
||
function _msgSender() internal view override(Context, GSNRecipient) returns (address payable) { | ||
return GSNRecipient._msgSender(); | ||
} | ||
|
||
function _msgData() internal view override(Context, GSNRecipient) returns (bytes storage) { | ||
return GSNRecipient._msgData(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
contracts/mutants/ERC721GSNRecipientMock/original/ERC721GSNRecipientMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "../token/ERC721/ERC721.sol"; | ||
import "../GSN/GSNRecipient.sol"; | ||
import "../GSN/GSNRecipientSignature.sol"; | ||
|
||
/** | ||
* @title ERC721GSNRecipientMock | ||
* A simple ERC721 mock that has GSN support enabled | ||
*/ | ||
contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature { | ||
constructor(string memory name, string memory symbol, address trustedSigner) | ||
public | ||
ERC721(name, symbol) | ||
GSNRecipientSignature(trustedSigner) | ||
{ } | ||
|
||
function mint(uint256 tokenId) public { | ||
_mint(_msgSender(), tokenId); | ||
} | ||
|
||
function _msgSender() internal view override(Context, GSNRecipient) returns (address payable) { | ||
return GSNRecipient._msgSender(); | ||
} | ||
|
||
function _msgData() internal view override(Context, GSNRecipient) returns (bytes memory) { | ||
return GSNRecipient._msgData(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "./IERC721Receiver.sol"; | ||
|
||
/** | ||
* @dev Implementation of the {IERC721Receiver} interface. | ||
* | ||
* Accepts all token transfers. | ||
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. | ||
*/ | ||
contract ERC721Holder is IERC721Receiver { | ||
|
||
/** | ||
* @dev See {IERC721Receiver-onERC721Received}. | ||
* | ||
* Always returns `IERC721Receiver.onERC721Received.selector`. | ||
*/ | ||
function onERC721Received(address, address, uint256, bytes storage) public virtual override returns (bytes4) { | ||
return this.onERC721Received.selector; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "./IERC721Receiver.sol"; | ||
|
||
/** | ||
* @dev Implementation of the {IERC721Receiver} interface. | ||
* | ||
* Accepts all token transfers. | ||
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. | ||
*/ | ||
contract ERC721Holder is IERC721Receiver { | ||
|
||
/** | ||
* @dev See {IERC721Receiver-onERC721Received}. | ||
* | ||
* Always returns `IERC721Receiver.onERC721Received.selector`. | ||
*/ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "./IERC721Receiver.sol"; | ||
|
||
/** | ||
* @dev Implementation of the {IERC721Receiver} interface. | ||
* | ||
* Accepts all token transfers. | ||
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. | ||
*/ | ||
contract ERC721Holder is IERC721Receiver { | ||
|
||
/** | ||
* @dev See {IERC721Receiver-onERC721Received}. | ||
* | ||
* Always returns `IERC721Receiver.onERC721Received.selector`. | ||
*/ | ||
function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { | ||
/* return this.onERC721Received.selector; */ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "./IERC721Receiver.sol"; | ||
|
||
/** | ||
* @dev Implementation of the {IERC721Receiver} interface. | ||
* | ||
* Accepts all token transfers. | ||
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. | ||
*/ | ||
contract ERC721Holder is IERC721Receiver { | ||
|
||
/** | ||
* @dev See {IERC721Receiver-onERC721Received}. | ||
* | ||
* Always returns `IERC721Receiver.onERC721Received.selector`. | ||
*/ | ||
function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { | ||
return this.onERC721Received.selector; | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
contracts/mutants/ERC721HolderUpgradeable/1/DLR/ERC721HolderUpgradeable.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// SPDX-License-Identifier: MIT | ||
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol) | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import "../IERC721ReceiverUpgradeable.sol"; | ||
import "../../../proxy/utils/Initializable.sol"; | ||
|
||
/** | ||
* @dev Implementation of the {IERC721Receiver} interface. | ||
* | ||
* Accepts all token transfers. | ||
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. | ||
*/ | ||
contract ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable { | ||
function __ERC721Holder_init() internal onlyInitializing { | ||
} | ||
|
||
function __ERC721Holder_init_unchained() internal onlyInitializing { | ||
} | ||
/** | ||
* @dev See {IERC721Receiver-onERC721Received}. | ||
* | ||
* Always returns `IERC721Receiver.onERC721Received.selector`. | ||
*/ | ||
function onERC721Received( | ||
address, | ||
address, | ||
uint256, | ||
bytes storage | ||
) public virtual override returns (bytes4) { | ||
return this.onERC721Received.selector; | ||
} | ||
|
||
/** | ||
* @dev This empty reserved space is put in place to allow future versions to add new | ||
* variables without shifting down storage in the inheritance chain. | ||
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps | ||
*/ | ||
uint256[50] private __gap; | ||
} |
41 changes: 41 additions & 0 deletions
41
contracts/mutants/ERC721HolderUpgradeable/1/FVR/ERC721HolderUpgradeable.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// SPDX-License-Identifier: MIT | ||
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol) | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import "../IERC721ReceiverUpgradeable.sol"; | ||
import "../../../proxy/utils/Initializable.sol"; | ||
|
||
/** | ||
* @dev Implementation of the {IERC721Receiver} interface. | ||
* | ||
* Accepts all token transfers. | ||
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. | ||
*/ | ||
contract ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable { | ||
function __ERC721Holder_init() public onlyInitializing { | ||
} | ||
|
||
function __ERC721Holder_init_unchained() internal onlyInitializing { | ||
} | ||
/** | ||
* @dev See {IERC721Receiver-onERC721Received}. | ||
* | ||
* Always returns `IERC721Receiver.onERC721Received.selector`. | ||
*/ | ||
function onERC721Received( | ||
address, | ||
address, | ||
uint256, | ||
bytes memory | ||
) public virtual override returns (bytes4) { | ||
return this.onERC721Received.selector; | ||
} | ||
|
||
/** | ||
* @dev This empty reserved space is put in place to allow future versions to add new | ||
* variables without shifting down storage in the inheritance chain. | ||
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps | ||
*/ | ||
uint256[50] private __gap; | ||
} |
41 changes: 41 additions & 0 deletions
41
contracts/mutants/ERC721HolderUpgradeable/1/ILR/ERC721HolderUpgradeable.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// SPDX-License-Identifier: MIT | ||
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol) | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import "../IERC721ReceiverUpgradeable.sol"; | ||
import "../../../proxy/utils/Initializable.sol"; | ||
|
||
/** | ||
* @dev Implementation of the {IERC721Receiver} interface. | ||
* | ||
* Accepts all token transfers. | ||
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. | ||
*/ | ||
contract ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable { | ||
function __ERC721Holder_init() internal onlyInitializing { | ||
} | ||
|
||
function __ERC721Holder_init_unchained() internal onlyInitializing { | ||
} | ||
/** | ||
* @dev See {IERC721Receiver-onERC721Received}. | ||
* | ||
* Always returns `IERC721Receiver.onERC721Received.selector`. | ||
*/ | ||
function onERC721Received( | ||
address, | ||
address, | ||
uint256, | ||
bytes memory | ||
) public virtual override returns (bytes4) { | ||
return this.onERC721Received.selector; | ||
} | ||
|
||
/** | ||
* @dev This empty reserved space is put in place to allow future versions to add new | ||
* variables without shifting down storage in the inheritance chain. | ||
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps | ||
*/ | ||
uint256[49] private __gap; | ||
} |
41 changes: 41 additions & 0 deletions
41
contracts/mutants/ERC721HolderUpgradeable/1/MOI/ERC721HolderUpgradeable.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// SPDX-License-Identifier: MIT | ||
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol) | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import "../IERC721ReceiverUpgradeable.sol"; | ||
import "../../../proxy/utils/Initializable.sol"; | ||
|
||
/** | ||
* @dev Implementation of the {IERC721Receiver} interface. | ||
* | ||
* Accepts all token transfers. | ||
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. | ||
*/ | ||
contract ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable { | ||
function __ERC721Holder_init() internal onlyInitializing { | ||
} | ||
|
||
function __ERC721Holder_init_unchained() internal onlyInitializing { | ||
} | ||
/** | ||
* @dev See {IERC721Receiver-onERC721Received}. | ||
* | ||
* Always returns `IERC721Receiver.onERC721Received.selector`. | ||
*/ | ||
function onERC721Received( | ||
address, | ||
address, | ||
uint256, | ||
bytes memory | ||
) public virtual override onlyInitializing returns (bytes4) { | ||
return this.onERC721Received.selector; | ||
} | ||
|
||
/** | ||
* @dev This empty reserved space is put in place to allow future versions to add new | ||
* variables without shifting down storage in the inheritance chain. | ||
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps | ||
*/ | ||
uint256[50] private __gap; | ||
} |
34 changes: 34 additions & 0 deletions
34
contracts/mutants/ERC721HolderUpgradeable/1/ORFD/ERC721HolderUpgradeable.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// SPDX-License-Identifier: MIT | ||
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol) | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import "../IERC721ReceiverUpgradeable.sol"; | ||
import "../../../proxy/utils/Initializable.sol"; | ||
|
||
/** | ||
* @dev Implementation of the {IERC721Receiver} interface. | ||
* | ||
* Accepts all token transfers. | ||
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. | ||
*/ | ||
contract ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable { | ||
function __ERC721Holder_init() internal onlyInitializing { | ||
} | ||
|
||
function __ERC721Holder_init_unchained() internal onlyInitializing { | ||
} | ||
/** | ||
* @dev See {IERC721Receiver-onERC721Received}. | ||
* | ||
* Always returns `IERC721Receiver.onERC721Received.selector`. | ||
*/ | ||
|
||
|
||
/** | ||
* @dev This empty reserved space is put in place to allow future versions to add new | ||
* variables without shifting down storage in the inheritance chain. | ||
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps | ||
*/ | ||
uint256[50] private __gap; | ||
} |
41 changes: 41 additions & 0 deletions
41
contracts/mutants/ERC721HolderUpgradeable/1/RSD/ERC721HolderUpgradeable.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// SPDX-License-Identifier: MIT | ||
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol) | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import "../IERC721ReceiverUpgradeable.sol"; | ||
import "../../../proxy/utils/Initializable.sol"; | ||
|
||
/** | ||
* @dev Implementation of the {IERC721Receiver} interface. | ||
* | ||
* Accepts all token transfers. | ||
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. | ||
*/ | ||
contract ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable { | ||
function __ERC721Holder_init() internal onlyInitializing { | ||
} | ||
|
||
function __ERC721Holder_init_unchained() internal onlyInitializing { | ||
} | ||
/** | ||
* @dev See {IERC721Receiver-onERC721Received}. | ||
* | ||
* Always returns `IERC721Receiver.onERC721Received.selector`. | ||
*/ | ||
function onERC721Received( | ||
address, | ||
address, | ||
uint256, | ||
bytes memory | ||
) public virtual override returns (bytes4) { | ||
/* return this.onERC721Received.selector; */ | ||
} | ||
|
||
/** | ||
* @dev This empty reserved space is put in place to allow future versions to add new | ||
* variables without shifting down storage in the inheritance chain. | ||
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps | ||
*/ | ||
uint256[50] private __gap; | ||
} |
41 changes: 41 additions & 0 deletions
41
contracts/mutants/ERC721HolderUpgradeable/1/VVR/ERC721HolderUpgradeable.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// SPDX-License-Identifier: MIT | ||
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol) | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import "../IERC721ReceiverUpgradeable.sol"; | ||
import "../../../proxy/utils/Initializable.sol"; | ||
|
||
/** | ||
* @dev Implementation of the {IERC721Receiver} interface. | ||
* | ||
* Accepts all token transfers. | ||
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. | ||
*/ | ||
contract ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable { | ||
function __ERC721Holder_init() internal onlyInitializing { | ||
} | ||
|
||
function __ERC721Holder_init_unchained() internal onlyInitializing { | ||
} | ||
/** | ||
* @dev See {IERC721Receiver-onERC721Received}. | ||
* | ||
* Always returns `IERC721Receiver.onERC721Received.selector`. | ||
*/ | ||
function onERC721Received( | ||
address, | ||
address, | ||
uint256, | ||
bytes memory | ||
) public virtual override returns (bytes4) { | ||
return this.onERC721Received.selector; | ||
} | ||
|
||
/** | ||
* @dev This empty reserved space is put in place to allow future versions to add new | ||
* variables without shifting down storage in the inheritance chain. | ||
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps | ||
*/ | ||
uint256[50] public __gap; | ||
} |
41 changes: 41 additions & 0 deletions
41
contracts/mutants/ERC721HolderUpgradeable/2/FVR/ERC721HolderUpgradeable.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// SPDX-License-Identifier: MIT | ||
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol) | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import "../IERC721ReceiverUpgradeable.sol"; | ||
import "../../../proxy/utils/Initializable.sol"; | ||
|
||
/** | ||
* @dev Implementation of the {IERC721Receiver} interface. | ||
* | ||
* Accepts all token transfers. | ||
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. | ||
*/ | ||
contract ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable { | ||
function __ERC721Holder_init() public onlyInitializing { | ||
} | ||
|
||
function __ERC721Holder_init_unchained() public onlyInitializing { | ||
} | ||
/** | ||
* @dev See {IERC721Receiver-onERC721Received}. | ||
* | ||
* Always returns `IERC721Receiver.onERC721Received.selector`. | ||
*/ | ||
function onERC721Received( | ||
address, | ||
address, | ||
uint256, | ||
bytes memory | ||
) public virtual override returns (bytes4) { | ||
return this.onERC721Received.selector; | ||
} | ||
|
||
/** | ||
* @dev This empty reserved space is put in place to allow future versions to add new | ||
* variables without shifting down storage in the inheritance chain. | ||
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps | ||
*/ | ||
uint256[50] private __gap; | ||
} |
41 changes: 41 additions & 0 deletions
41
contracts/mutants/ERC721HolderUpgradeable/original/ERC721HolderUpgradeable.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// SPDX-License-Identifier: MIT | ||
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol) | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import "../IERC721ReceiverUpgradeable.sol"; | ||
import "../../../proxy/utils/Initializable.sol"; | ||
|
||
/** | ||
* @dev Implementation of the {IERC721Receiver} interface. | ||
* | ||
* Accepts all token transfers. | ||
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. | ||
*/ | ||
contract ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable { | ||
function __ERC721Holder_init() internal onlyInitializing { | ||
} | ||
|
||
function __ERC721Holder_init_unchained() internal onlyInitializing { | ||
} | ||
/** | ||
* @dev See {IERC721Receiver-onERC721Received}. | ||
* | ||
* Always returns `IERC721Receiver.onERC721Received.selector`. | ||
*/ | ||
function onERC721Received( | ||
address, | ||
address, | ||
uint256, | ||
bytes memory | ||
) public virtual override returns (bytes4) { | ||
return this.onERC721Received.selector; | ||
} | ||
|
||
/** | ||
* @dev This empty reserved space is put in place to allow future versions to add new | ||
* variables without shifting down storage in the inheritance chain. | ||
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps | ||
*/ | ||
uint256[50] private __gap; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) public { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length > 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
|
||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) public { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (true) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) public { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
_tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) public { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes1(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) public { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
/* require(_exists(tokenId)); */ | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) internal { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) public { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 1) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) public { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
/* return _name; */ | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) public { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
_burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string public _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) public { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) public { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
/* require(_exists(tokenId)); */ | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
/* require(_exists(tokenId)); */ | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) internal { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() public view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) public { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
/* return _name; */ | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
/* return _symbol; */ | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string public _name; | ||
|
||
// Token symbol | ||
string public _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) public { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) internal { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() public view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() public view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) public { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
/* return _name; */ | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
/* return _symbol; */ | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
/* return _tokenURIs[tokenId]; */ | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string public _name; | ||
|
||
// Token symbol | ||
string public _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 public constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) public { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) internal { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() public view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() public view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) public view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) internal { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() public view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() public view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) public view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) public { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) internal { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() public view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() public view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) public view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) public { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) public { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
87 changes: 87 additions & 0 deletions
87
contracts/mutants/ERC721Metadata/original/ERC721Metadata.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "./IERC721Metadata.sol"; | ||
import "../../introspection/ERC165.sol"; | ||
|
||
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { | ||
// Token name | ||
string private _name; | ||
|
||
// Token symbol | ||
string private _symbol; | ||
|
||
// Optional mapping for token URIs | ||
mapping(uint256 => string) private _tokenURIs; | ||
|
||
bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f; | ||
/** | ||
* 0x5b5e139f === | ||
* bytes4(keccak256('name()')) ^ | ||
* bytes4(keccak256('symbol()')) ^ | ||
* bytes4(keccak256('tokenURI(uint256)')) | ||
*/ | ||
|
||
/** | ||
* @dev Constructor function | ||
*/ | ||
constructor(string name, string symbol) public { | ||
_name = name; | ||
_symbol = symbol; | ||
|
||
// register the supported interfaces to conform to ERC721 via ERC165 | ||
_registerInterface(InterfaceId_ERC721Metadata); | ||
} | ||
|
||
/** | ||
* @dev Gets the token name | ||
* @return string representing the token name | ||
*/ | ||
function name() external view returns (string) { | ||
return _name; | ||
} | ||
|
||
/** | ||
* @dev Gets the token symbol | ||
* @return string representing the token symbol | ||
*/ | ||
function symbol() external view returns (string) { | ||
return _symbol; | ||
} | ||
|
||
/** | ||
* @dev Returns an URI for a given token ID | ||
* Throws if the token ID does not exist. May return an empty string. | ||
* @param tokenId uint256 ID of the token to query | ||
*/ | ||
function tokenURI(uint256 tokenId) external view returns (string) { | ||
require(_exists(tokenId)); | ||
return _tokenURIs[tokenId]; | ||
} | ||
|
||
/** | ||
* @dev Internal function to set the token URI for a given token | ||
* Reverts if the token ID does not exist | ||
* @param tokenId uint256 ID of the token to set its URI | ||
* @param uri string URI to assign | ||
*/ | ||
function _setTokenURI(uint256 tokenId, string uri) internal { | ||
require(_exists(tokenId)); | ||
_tokenURIs[tokenId] = uri; | ||
} | ||
|
||
/** | ||
* @dev Internal function to burn a specific token | ||
* Reverts if the token does not exist | ||
* @param owner owner of the token to burn | ||
* @param tokenId uint256 ID of the token being burned by the msg.sender | ||
*/ | ||
function _burn(address owner, uint256 tokenId) internal { | ||
super._burn(owner, tokenId); | ||
|
||
// Clear metadata (if any) | ||
if (bytes(_tokenURIs[tokenId]).length != 0) { | ||
delete _tokenURIs[tokenId]; | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
contracts/mutants/ERC721MetadataMintable/1/BLR/ERC721MetadataMintable.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721Metadata.sol"; | ||
import "../../access/roles/MinterRole.sol"; | ||
|
||
|
||
/** | ||
* @title ERC721MetadataMintable | ||
* @dev ERC721 minting logic with metadata | ||
*/ | ||
contract ERC721MetadataMintable is ERC721, ERC721Metadata, MinterRole { | ||
/** | ||
* @dev Function to mint tokens | ||
* @param to The address that will receive the minted tokens. | ||
* @param tokenId The token id to mint. | ||
* @param tokenURI The token URI of the minted token. | ||
* @return A boolean that indicates if the operation was successful. | ||
*/ | ||
function mintWithTokenURI( | ||
address to, | ||
uint256 tokenId, | ||
string tokenURI | ||
) | ||
public | ||
onlyMinter | ||
returns (bool) | ||
{ | ||
_mint(to, tokenId); | ||
_setTokenURI(tokenId, tokenURI); | ||
return false; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
contracts/mutants/ERC721MetadataMintable/1/FVR/ERC721MetadataMintable.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721Metadata.sol"; | ||
import "../../access/roles/MinterRole.sol"; | ||
|
||
|
||
/** | ||
* @title ERC721MetadataMintable | ||
* @dev ERC721 minting logic with metadata | ||
*/ | ||
contract ERC721MetadataMintable is ERC721, ERC721Metadata, MinterRole { | ||
/** | ||
* @dev Function to mint tokens | ||
* @param to The address that will receive the minted tokens. | ||
* @param tokenId The token id to mint. | ||
* @param tokenURI The token URI of the minted token. | ||
* @return A boolean that indicates if the operation was successful. | ||
*/ | ||
function mintWithTokenURI( | ||
address to, | ||
uint256 tokenId, | ||
string tokenURI | ||
) | ||
external | ||
onlyMinter | ||
returns (bool) | ||
{ | ||
_mint(to, tokenId); | ||
_setTokenURI(tokenId, tokenURI); | ||
return true; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
contracts/mutants/ERC721MetadataMintable/1/RSD/ERC721MetadataMintable.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721Metadata.sol"; | ||
import "../../access/roles/MinterRole.sol"; | ||
|
||
|
||
/** | ||
* @title ERC721MetadataMintable | ||
* @dev ERC721 minting logic with metadata | ||
*/ | ||
contract ERC721MetadataMintable is ERC721, ERC721Metadata, MinterRole { | ||
/** | ||
* @dev Function to mint tokens | ||
* @param to The address that will receive the minted tokens. | ||
* @param tokenId The token id to mint. | ||
* @param tokenURI The token URI of the minted token. | ||
* @return A boolean that indicates if the operation was successful. | ||
*/ | ||
function mintWithTokenURI( | ||
address to, | ||
uint256 tokenId, | ||
string tokenURI | ||
) | ||
public | ||
onlyMinter | ||
returns (bool) | ||
{ | ||
_mint(to, tokenId); | ||
_setTokenURI(tokenId, tokenURI); | ||
/* return true; */ | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
contracts/mutants/ERC721MetadataMintable/original/ERC721MetadataMintable.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721Metadata.sol"; | ||
import "../../access/roles/MinterRole.sol"; | ||
|
||
|
||
/** | ||
* @title ERC721MetadataMintable | ||
* @dev ERC721 minting logic with metadata | ||
*/ | ||
contract ERC721MetadataMintable is ERC721, ERC721Metadata, MinterRole { | ||
/** | ||
* @dev Function to mint tokens | ||
* @param to The address that will receive the minted tokens. | ||
* @param tokenId The token id to mint. | ||
* @param tokenURI The token URI of the minted token. | ||
* @return A boolean that indicates if the operation was successful. | ||
*/ | ||
function mintWithTokenURI( | ||
address to, | ||
uint256 tokenId, | ||
string tokenURI | ||
) | ||
public | ||
onlyMinter | ||
returns (bool) | ||
{ | ||
_mint(to, tokenId); | ||
_setTokenURI(tokenId, tokenURI); | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "../../access/roles/MinterRole.sol"; | ||
|
||
/** | ||
* @title ERC721Mintable | ||
* @dev ERC721 minting logic | ||
*/ | ||
contract ERC721Mintable is ERC721, MinterRole { | ||
/** | ||
* @dev Function to mint tokens | ||
* @param to The address that will receive the minted tokens. | ||
* @param tokenId The token id to mint. | ||
* @return A boolean that indicates if the operation was successful. | ||
*/ | ||
function mint( | ||
address to, | ||
uint256 tokenId | ||
) | ||
public | ||
onlyMinter | ||
returns (bool) | ||
{ | ||
_mint(to, tokenId); | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "../../access/roles/MinterRole.sol"; | ||
|
||
/** | ||
* @title ERC721Mintable | ||
* @dev ERC721 minting logic | ||
*/ | ||
contract ERC721Mintable is ERC721, MinterRole { | ||
/** | ||
* @dev Function to mint tokens | ||
* @param to The address that will receive the minted tokens. | ||
* @param tokenId The token id to mint. | ||
* @return A boolean that indicates if the operation was successful. | ||
*/ | ||
function mint( | ||
address to, | ||
uint256 tokenId | ||
) | ||
external | ||
onlyMinter | ||
returns (bool) | ||
{ | ||
_mint(to, tokenId); | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "../../access/roles/MinterRole.sol"; | ||
|
||
/** | ||
* @title ERC721Mintable | ||
* @dev ERC721 minting logic | ||
*/ | ||
contract ERC721Mintable is ERC721, MinterRole { | ||
/** | ||
* @dev Function to mint tokens | ||
* @param to The address that will receive the minted tokens. | ||
* @param tokenId The token id to mint. | ||
* @return A boolean that indicates if the operation was successful. | ||
*/ | ||
function mint( | ||
address to, | ||
uint256 tokenId | ||
) | ||
public | ||
|
||
returns (bool) | ||
{ | ||
_mint(to, tokenId); | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "../../access/roles/MinterRole.sol"; | ||
|
||
/** | ||
* @title ERC721Mintable | ||
* @dev ERC721 minting logic | ||
*/ | ||
contract ERC721Mintable is ERC721, MinterRole { | ||
/** | ||
* @dev Function to mint tokens | ||
* @param to The address that will receive the minted tokens. | ||
* @param tokenId The token id to mint. | ||
* @return A boolean that indicates if the operation was successful. | ||
*/ | ||
function mint( | ||
address to, | ||
uint256 tokenId | ||
) | ||
public | ||
onlyMinter | ||
returns (bool) | ||
{ | ||
_mint(to, tokenId); | ||
/* return true; */ | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
contracts/mutants/ERC721Mintable/original/ERC721Mintable.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "./ERC721.sol"; | ||
import "../../access/roles/MinterRole.sol"; | ||
|
||
/** | ||
* @title ERC721Mintable | ||
* @dev ERC721 minting logic | ||
*/ | ||
contract ERC721Mintable is ERC721, MinterRole { | ||
/** | ||
* @dev Function to mint tokens | ||
* @param to The address that will receive the minted tokens. | ||
* @param tokenId The token id to mint. | ||
* @return A boolean that indicates if the operation was successful. | ||
*/ | ||
function mint( | ||
address to, | ||
uint256 tokenId | ||
) | ||
public | ||
onlyMinter | ||
returns (bool) | ||
{ | ||
_mint(to, tokenId); | ||
return true; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
contracts/mutants/ERC721MintableBurnableImpl/1/CCD/ERC721MintableBurnableImpl.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "../token/ERC721/ERC721Full.sol"; | ||
import "../token/ERC721/ERC721Mintable.sol"; | ||
import "../token/ERC721/ERC721MetadataMintable.sol"; | ||
import "../token/ERC721/ERC721Burnable.sol"; | ||
|
||
/** | ||
* @title ERC721MintableBurnableImpl | ||
*/ | ||
contract ERC721MintableBurnableImpl | ||
is ERC721Full, ERC721Mintable, ERC721MetadataMintable, ERC721Burnable { | ||
|
||
|
||
} |
20 changes: 20 additions & 0 deletions
20
contracts/mutants/ERC721MintableBurnableImpl/1/FVR/ERC721MintableBurnableImpl.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "../token/ERC721/ERC721Full.sol"; | ||
import "../token/ERC721/ERC721Mintable.sol"; | ||
import "../token/ERC721/ERC721MetadataMintable.sol"; | ||
import "../token/ERC721/ERC721Burnable.sol"; | ||
|
||
/** | ||
* @title ERC721MintableBurnableImpl | ||
*/ | ||
contract ERC721MintableBurnableImpl | ||
is ERC721Full, ERC721Mintable, ERC721MetadataMintable, ERC721Burnable { | ||
|
||
constructor() | ||
ERC721Mintable() | ||
ERC721Full("Test", "TEST") | ||
internal | ||
{ | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
contracts/mutants/ERC721MintableBurnableImpl/1/MOC/ERC721MintableBurnableImpl.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "../token/ERC721/ERC721Full.sol"; | ||
import "../token/ERC721/ERC721Mintable.sol"; | ||
import "../token/ERC721/ERC721MetadataMintable.sol"; | ||
import "../token/ERC721/ERC721Burnable.sol"; | ||
|
||
/** | ||
* @title ERC721MintableBurnableImpl | ||
*/ | ||
contract ERC721MintableBurnableImpl | ||
is ERC721Full, ERC721Mintable, ERC721MetadataMintable, ERC721Burnable { | ||
|
||
constructor() | ||
ERC721Full("Test", "TEST") | ||
ERC721Mintable() | ||
public | ||
{ | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
contracts/mutants/ERC721MintableBurnableImpl/1/MOD/ERC721MintableBurnableImpl.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "../token/ERC721/ERC721Full.sol"; | ||
import "../token/ERC721/ERC721Mintable.sol"; | ||
import "../token/ERC721/ERC721MetadataMintable.sol"; | ||
import "../token/ERC721/ERC721Burnable.sol"; | ||
|
||
/** | ||
* @title ERC721MintableBurnableImpl | ||
*/ | ||
contract ERC721MintableBurnableImpl | ||
is ERC721Full, ERC721Mintable, ERC721MetadataMintable, ERC721Burnable { | ||
|
||
constructor() | ||
ERC721Full("Test", "TEST") | ||
ERC721Mintable() | ||
public | ||
{ | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
contracts/mutants/ERC721MintableBurnableImpl/1/SLR/ERC721MintableBurnableImpl.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "../token/ERC721/ERC721Full.sol"; | ||
import "../token/ERC721/ERC721Mintable.sol"; | ||
import "../token/ERC721/ERC721MetadataMintable.sol"; | ||
import "../token/ERC721/ERC721Burnable.sol"; | ||
|
||
/** | ||
* @title ERC721MintableBurnableImpl | ||
*/ | ||
contract ERC721MintableBurnableImpl | ||
is ERC721Full, ERC721Mintable, ERC721MetadataMintable, ERC721Burnable { | ||
|
||
constructor() | ||
ERC721Mintable() | ||
ERC721Full("", "TEST") | ||
public | ||
{ | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
contracts/mutants/ERC721MintableBurnableImpl/2/SLR/ERC721MintableBurnableImpl.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "../token/ERC721/ERC721Full.sol"; | ||
import "../token/ERC721/ERC721Mintable.sol"; | ||
import "../token/ERC721/ERC721MetadataMintable.sol"; | ||
import "../token/ERC721/ERC721Burnable.sol"; | ||
|
||
/** | ||
* @title ERC721MintableBurnableImpl | ||
*/ | ||
contract ERC721MintableBurnableImpl | ||
is ERC721Full, ERC721Mintable, ERC721MetadataMintable, ERC721Burnable { | ||
|
||
constructor() | ||
ERC721Mintable() | ||
ERC721Full("", "") | ||
public | ||
{ | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
contracts/mutants/ERC721MintableBurnableImpl/original/ERC721MintableBurnableImpl.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
import "../token/ERC721/ERC721Full.sol"; | ||
import "../token/ERC721/ERC721Mintable.sol"; | ||
import "../token/ERC721/ERC721MetadataMintable.sol"; | ||
import "../token/ERC721/ERC721Burnable.sol"; | ||
|
||
/** | ||
* @title ERC721MintableBurnableImpl | ||
*/ | ||
contract ERC721MintableBurnableImpl | ||
is ERC721Full, ERC721Mintable, ERC721MetadataMintable, ERC721Burnable { | ||
|
||
constructor() | ||
ERC721Mintable() | ||
ERC721Full("Test", "TEST") | ||
public | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
import "../token/ERC721/ERC721.sol"; | ||
|
||
/** | ||
* @title ERC721Mock | ||
* This mock just provides a public safeMint, mint, and burn functions for testing purposes | ||
*/ | ||
contract ERC721Mock is ERC721 { | ||
|
||
|
||
function exists(uint256 tokenId) public view returns (bool) { | ||
return _exists(tokenId); | ||
} | ||
|
||
function setTokenURI(uint256 tokenId, string memory uri) public { | ||
_setTokenURI(tokenId, uri); | ||
} | ||
|
||
function setBaseURI(string memory baseURI) public { | ||
_setBaseURI(baseURI); | ||
} | ||
|
||
function mint(address to, uint256 tokenId) public { | ||
_mint(to, tokenId); | ||
} | ||
|
||
function safeMint(address to, uint256 tokenId) public { | ||
_safeMint(to, tokenId); | ||
} | ||
|
||
function safeMint(address to, uint256 tokenId, bytes memory _data) public { | ||
_safeMint(to, tokenId, _data); | ||
} | ||
|
||
function burn(uint256 tokenId) public { | ||
_burn(tokenId); | ||
} | ||
} |
Oops, something went wrong.