forked from leon-do/ERC721
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var my721 = artifacts.require("my721"); | ||
module.exports = function(deployer){ | ||
deployer.deploy(my721); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
pragma solidity ^0.5.0; | ||
//import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | ||
|
||
contract my721 is ERC721{ | ||
|
||
mapping(address => uint) tokens; | ||
|
||
function approval(address _owner, address _approved,uint _tokenId){ | ||
require(tokens[_owner]==_tokenId); | ||
tokens[_approved]=_tokenId; | ||
} | ||
function transfer(address _to, uint _amount) public{ | ||
require(_amount <= tokens[msg.sender]); | ||
tokens[msg.sender]-=_amount; | ||
tokens[_to]+=_amount; | ||
} | ||
function balanceOf(address _owner) public view returns (uint){ | ||
return tokens[_owner]; | ||
} | ||
function ownerOf(uint _tokenId) public view returns(address){ | ||
return tokens[_id].address; | ||
} | ||
function TransferFrom(address _from, address _to, uint _tokenId) payable{ | ||
|
||
} | ||
function approve(address _approved, uint _tokenId) payable{ | ||
|
||
} | ||
|
||
function mint(address _to, uint _id) public{ | ||
super._mint(_to,_id); | ||
} | ||
|