How do I retriever Token_Id of cryptokitties from ERC721 Smart contract

enter image description here

Smart contract address : https://etherscan.io/address/0x06012c8cf97bead5deae237070f9587f8e7a266d#code


That Token_Id is the index of the Kitty instance in the kitties array, which, according to the comment in the published smart contract, represents:

 /// @dev An array containing the Kitty struct for all Kitties in existence. The ID
    ///  of each cat is actually an index into this array. Note that ID 0 is a negacat,
    ///  the unKitty, the mythical beast that is the parent of all gen0 cats. A bizarre
    ///  creature that is both matron and sire... to itself! Has an invalid genetic code.
    ///  In other words, cat ID 0 is invalid... ;-)
    Kitty[] kitties;

The totalSupply() function in the smart contract returns the total number of kitties in existence.

  • Thank Tudor Constanin for your reply but I want to get my own tokenID not total amount. – Hu Kenneth Nov 11 '18 at 9:40

This is the public interface: https://etherscan.io/address/0x06012c8cf97bead5deae237070f9587f8e7a266d#readContract. It's hard to understand what you're exactly asking, but that's what there is.

  • I want to know how many ERC721 tokens user have – Hu Kenneth Feb 26 '19 at 1:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.