-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove enumerable from ERC721 and add an ERC721Enumerable extension (#…
…2511) Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
- Loading branch information
Showing
11 changed files
with
1,248 additions
and
1,033 deletions.
There are no files selected for viewing
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
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,43 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import "../token/ERC721/ERC721Enumerable.sol"; | ||
|
||
/** | ||
* @title ERC721Mock | ||
* This mock just provides a public safeMint, mint, and burn functions for testing purposes | ||
*/ | ||
contract ERC721EnumerableMock is ERC721Enumerable { | ||
string private _baseTokenURI; | ||
|
||
constructor (string memory name, string memory symbol) ERC721(name, symbol) { } | ||
|
||
function _baseURI() internal view virtual override returns (string memory) { | ||
return _baseTokenURI; | ||
} | ||
|
||
function setBaseURI(string calldata newBaseTokenURI) public { | ||
_baseTokenURI = newBaseTokenURI; | ||
} | ||
|
||
function baseURI() public view returns (string memory) { | ||
return _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); | ||
} | ||
} |
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
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
Oops, something went wrong.