convert ERC721 to initializers
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
pragma solidity ^0.4.24;
|
||||
|
||||
import "../Initializable.sol";
|
||||
import "../token/ERC721/ERC721.sol";
|
||||
|
||||
|
||||
@ -7,7 +8,11 @@ import "../token/ERC721/ERC721.sol";
|
||||
* @title ERC721Mock
|
||||
* This mock just provides a public mint and burn functions for testing purposes
|
||||
*/
|
||||
contract ERC721Mock is ERC721 {
|
||||
contract ERC721Mock is Initializable, ERC721 {
|
||||
constructor() public {
|
||||
ERC721.initialize();
|
||||
}
|
||||
|
||||
function mint(address to, uint256 tokenId) public {
|
||||
_mint(to, tokenId);
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
pragma solidity ^0.4.24;
|
||||
|
||||
import "../../Initializable.sol";
|
||||
import "./IERC721.sol";
|
||||
import "./IERC721Receiver.sol";
|
||||
import "../../math/SafeMath.sol";
|
||||
@ -11,7 +12,7 @@ import "../../introspection/ERC165.sol";
|
||||
* @title ERC721 Non-Fungible Token Standard basic implementation
|
||||
* @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
|
||||
*/
|
||||
contract ERC721 is ERC165, IERC721 {
|
||||
contract ERC721 is Initializable, ERC165, IERC721 {
|
||||
|
||||
using SafeMath for uint256;
|
||||
using Address for address;
|
||||
@ -46,9 +47,12 @@ contract ERC721 is ERC165, IERC721 {
|
||||
* bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)'))
|
||||
*/
|
||||
|
||||
constructor()
|
||||
function initialize()
|
||||
public
|
||||
initializer
|
||||
{
|
||||
ERC165.initialize();
|
||||
|
||||
// register the supported interfaces to conform to ERC721 via ERC165
|
||||
_registerInterface(_InterfaceId_ERC721);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user