I;m trying to query a Cryptokitties token metadata from Etherscan and I need to give two values: _tokenId (uint256) and _preferredTransport (string).

What are possible value for _preferredTransport?

  • hello, do you finally find how to query kitty's metadata?
    – afu802
    Commented May 11, 2020 at 7:51
  • Nope. But you can get some info through the getKitty query Commented May 11, 2020 at 12:01

1 Answer 1


Looks like it's deprecated (no longer in use):

function tokenMetadata(uint256 _tokenId, string _preferredTransport) external view returns (string infoUrl) {
    require(erc721Metadata != address(0));
    bytes32[4] memory buffer;
    uint256 count;
    (buffer, count) = erc721Metadata.getMetadata(_tokenId, _preferredTransport);

    return _toString(buffer, count);

function getMetadata(uint256 _tokenId, string) public view returns (bytes32[4] buffer, uint256 count) {
    if (_tokenId == 1) {
        buffer[0] = "Hello World! :D";
        count = 15;
    } else if (_tokenId == 2) {
        buffer[0] = "I would definitely choose a medi";
        buffer[1] = "um length string.";
        count = 49;
    } else if (_tokenId == 3) {
        buffer[0] = "Lorem ipsum dolor sit amet, mi e";
        buffer[1] = "st accumsan dapibus augue lorem,";
        buffer[2] = " tristique vestibulum id, libero";
        buffer[3] = " suscipit varius sapien aliquam.";
        count = 128;

As you can see, the 2nd input argument has no name, and is there for not in use.

  • Thanks! — and now how would I request the metadata from Etherscan? as a value is required for preferredTransport Commented Apr 23, 2020 at 16:38
  • @PmRivière: "not in use" means that you can pass whatever you want, and it will have no impact on the result! Commented Apr 23, 2020 at 16:39
  • It looks like erc721Metadata is address(0), so tokenMetadata will fail no matter what. I think getKitty is the how you should get data about the token
    – natewelch_
    Commented Apr 23, 2020 at 17:04
  • @flygoing: Yes, it means that function tokenMetadata will always revert (until someone changes this currently null pointer). But you've asked a general question about a function which takes "_tokenId (uint256) and _preferredTransport (string)" (without specifying anything beyond that BTW, not even the contract address which I had to look up myself). And I have answered that question. If you have another question about another function, then you should post it separately, and accept this answer if you feel it has answered the your question. Otherwise, please explain what else is missing. Commented Apr 23, 2020 at 17:10
  • @goodvibration thanks for the answer and sorry I didn't produce the contract address Commented Apr 24, 2020 at 3:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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