강의

멘토링

커뮤니티

Inflearn Community Q&A

myungsu893875's profile image
myungsu893875

asked

Creating Klaytn Blockchain Applications - NFT

Klaytn IDE 인터페이스가 바뀌어서 그런지 몰라도 뭔가 좀 안되네유

Written on

·

246

0

ERC-721 실습 -> 계정 발란스 & 토큰 소유자 편 보고 있는데요,
 
1. run하기 전에 account 선택하는 창도 안보이고
2. run 누르면 not found remix_tests.sol 이라고 뜨네요
 
코드는 아래와 같이 따라서 썼거든요 ㅠㅠ
 
// Klaytn IDE uses solidity 0.4.24,

pragma solidity >=0.4.24 <=0.5.16;

interface ERC721 /* is ERC165 */ {
    event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);
    event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId);
    event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);

    function balanceOf(address _owner) public view returns (uint256);
    function ownerOf(uint256 _tokenId) public view returns (address);
    function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) public;
    function safeTransferFrom(address _from, address _to, uint256 _tokenId) public;
    function transferFrom(address _from, address _to, uint256 _tokenId) public;
    function approve(address _approved, uint256 _tokenId) public;
    function setApprovalForAll(address _operator, bool _approved) public;
    function getApproved(uint256 _tokenId) public view returns (address);
    function isApprovedForAll(address _owner, address _operator) public view returns (bool);
}



contract ERC721Implementation is ERC721 {

    mapping (uint256 => address) tokenOwner;
    mapping (address => uint256) ownedTokensCount;

    function mint(address _to, uint _tokenId) public {
        tokenOwner[_tokenId] = _to;
        ownedTokensCount[_to] += 1;
    } 


    function balanceOf(address _owner) public view returns (uint256) {
        return ownedTokensCount[_owner];
    }

    function ownerOf(uint256 _tokenId) public view returns (address) {
        return tokenOwner[_tokenId];        
    }
}






nft웹앱blockchain

Answer

This question is waiting for answers
Be the first to answer!
myungsu893875's profile image
myungsu893875

asked

Ask a question