Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle ERC721 extensions into base contract #2149

Merged
merged 9 commits into from
Mar 27, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions contracts/mocks/ERC721BurnableMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ pragma solidity ^0.6.0;
import "../token/ERC721/ERC721Burnable.sol";

contract ERC721BurnableMock is ERC721Burnable {
constructor(string memory name, string memory symbol) public ERC721Burnable(name, symbol) { }

function mint(address to, uint256 tokenId) public {
_mint(to, tokenId);
}
Expand Down
37 changes: 0 additions & 37 deletions contracts/mocks/ERC721FullMock.sol

This file was deleted.

6 changes: 5 additions & 1 deletion contracts/mocks/ERC721GSNRecipientMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import "../GSN/GSNRecipientSignature.sol";
* A simple ERC721 mock that has GSN support enabled
*/
contract ERC721GSNRecipientMock is ERC721, GSNRecipient, GSNRecipientSignature {
constructor(address trustedSigner) public GSNRecipientSignature(trustedSigner) { }
constructor(string memory name, string memory symbol, address trustedSigner)
public
ERC721(name, symbol)
GSNRecipientSignature(trustedSigner)
{ }

function mint(uint256 tokenId) public {
_mint(_msgSender(), tokenId);
Expand Down
26 changes: 22 additions & 4 deletions contracts/mocks/ERC721Mock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,36 @@ import "../token/ERC721/ERC721.sol";
* This mock just provides a public safeMint, mint, and burn functions for testing purposes
*/
contract ERC721Mock is ERC721 {
function safeMint(address to, uint256 tokenId) public {
_safeMint(to, tokenId);
constructor (string memory name, string memory symbol) public ERC721(name, symbol) { }

function exists(uint256 tokenId) public view returns (bool) {
return _exists(tokenId);
}

function safeMint(address to, uint256 tokenId, bytes memory _data) public {
_safeMint(to, tokenId, _data);
function tokensOfOwner(address owner) public view returns (uint256[] memory) {
return _tokensOfOwner(owner);
}

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);
}
Expand Down
2 changes: 2 additions & 0 deletions contracts/mocks/ERC721PausableMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import "../token/ERC721/ERC721Pausable.sol";
* This mock just provides a public mint, burn and exists functions for testing purposes
*/
contract ERC721PausableMock is ERC721Pausable {
constructor (string memory name, string memory symbol) public ERC721Pausable(name, symbol) { }

function mint(address to, uint256 tokenId) public {
super._mint(to, tokenId);
}
Expand Down
Loading