Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
alisya-k authored Dec 30, 2019
1 parent 64f2b0a commit 1e92d04
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
4 changes: 4 additions & 0 deletions 2_deploy_contracts.js
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);
}
33 changes: 33 additions & 0 deletions contract721.sol
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);
}

0 comments on commit 1e92d04

Please sign in to comment.