Skip to content

Improved ERC721 granularity #1304

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

Merged
merged 5 commits into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
18 changes: 0 additions & 18 deletions contracts/mocks/ERC721BasicMock.sol

This file was deleted.

30 changes: 30 additions & 0 deletions contracts/mocks/ERC721FullMock.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
pragma solidity ^0.4.24;

import "../token/ERC721/ERC721Full.sol";
import "../token/ERC721/ERC721Mintable.sol";
import "../token/ERC721/ERC721Burnable.sol";


/**
* @title ERC721Mock
* This mock just provides a public mint and burn functions for testing purposes,
* and a public setter for metadata URI
*/
contract ERC721FullMock is ERC721Full, ERC721Mintable, ERC721Burnable {
constructor(string name, string symbol) public
ERC721Mintable()
ERC721Full(name, symbol)
{}

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

function setTokenURI(uint256 tokenId, string uri) public {
_setTokenURI(tokenId, uri);
}

function removeTokenFrom(address from, uint256 tokenId) public {
_removeTokenFrom(from, tokenId);
}
}
8 changes: 5 additions & 3 deletions contracts/mocks/ERC721MintableBurnableImpl.sol
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
pragma solidity ^0.4.24;

import "../token/ERC721/ERC721.sol";
import "../token/ERC721/ERC721Full.sol";
import "../token/ERC721/ERC721Mintable.sol";
import "../token/ERC721/ERC721Burnable.sol";


/**
* @title ERC721MintableBurnableImpl
*/
contract ERC721MintableBurnableImpl is ERC721, ERC721Mintable, ERC721Burnable {
contract ERC721MintableBurnableImpl
is ERC721Full, ERC721Mintable, ERC721Burnable {

constructor()
ERC721Mintable()
ERC721("Test", "TEST")
ERC721Full("Test", "TEST")
public
{
}
Expand Down
24 changes: 6 additions & 18 deletions contracts/mocks/ERC721Mock.sol
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
pragma solidity ^0.4.24;

import "../token/ERC721/ERC721.sol";
import "../token/ERC721/ERC721Mintable.sol";
import "../token/ERC721/ERC721Burnable.sol";


/**
* @title ERC721Mock
* This mock just provides a public mint and burn functions for testing purposes,
* and a public setter for metadata URI
* This mock just provides a public mint and burn functions for testing purposes
*/
contract ERC721Mock is ERC721, ERC721Mintable, ERC721Burnable {
constructor(string name, string symbol) public
ERC721Mintable()
ERC721(name, symbol)
{}

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

function setTokenURI(uint256 tokenId, string uri) public {
_setTokenURI(tokenId, uri);
contract ERC721Mock is ERC721 {
function mint(address to, uint256 tokenId) public {
_mint(to, tokenId);
}

function removeTokenFrom(address from, uint256 tokenId) public {
_removeTokenFrom(from, tokenId);
function burn(uint256 tokenId) public {
_burn(ownerOf(tokenId), tokenId);
}
}
Loading