Commit 416c4ced by Francisco Giordano

convert ERC721 to initializers

parent 3f51d342
pragma solidity ^0.4.24; pragma solidity ^0.4.24;
import "../Initializable.sol";
import "../token/ERC721/ERC721.sol"; import "../token/ERC721/ERC721.sol";
...@@ -7,7 +8,11 @@ import "../token/ERC721/ERC721.sol"; ...@@ -7,7 +8,11 @@ import "../token/ERC721/ERC721.sol";
* @title ERC721Mock * @title ERC721Mock
* This mock just provides a public mint and burn functions for testing purposes * 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 { function mint(address to, uint256 tokenId) public {
_mint(to, tokenId); _mint(to, tokenId);
} }
......
pragma solidity ^0.4.24; pragma solidity ^0.4.24;
import "../../Initializable.sol";
import "./IERC721.sol"; import "./IERC721.sol";
import "./IERC721Receiver.sol"; import "./IERC721Receiver.sol";
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
...@@ -11,7 +12,7 @@ import "../../introspection/ERC165.sol"; ...@@ -11,7 +12,7 @@ import "../../introspection/ERC165.sol";
* @title ERC721 Non-Fungible Token Standard basic implementation * @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md * @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 SafeMath for uint256;
using Address for address; using Address for address;
...@@ -46,9 +47,12 @@ contract ERC721 is ERC165, IERC721 { ...@@ -46,9 +47,12 @@ contract ERC721 is ERC165, IERC721 {
* bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) * bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)'))
*/ */
constructor() function initialize()
public public
initializer
{ {
ERC165.initialize();
// register the supported interfaces to conform to ERC721 via ERC165 // register the supported interfaces to conform to ERC721 via ERC165
_registerInterface(_InterfaceId_ERC721); _registerInterface(_InterfaceId_ERC721);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment