Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
416c4ced
Commit
416c4ced
authored
Sep 25, 2018
by
Francisco Giordano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert ERC721 to initializers
parent
3f51d342
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
ERC721Mock.sol
contracts/mocks/ERC721Mock.sol
+6
-1
ERC721.sol
contracts/token/ERC721/ERC721.sol
+6
-2
No files found.
contracts/mocks/ERC721Mock.sol
View file @
416c4ced
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);
}
}
...
...
contracts/token/ERC721/ERC721.sol
View file @
416c4ced
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);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment