Etherscan

如何從 Etherscan 查詢 Cryptokitties 元數據

  • May 1, 2020

我正在嘗試從 Etherscan 查詢 Cryptokitties 令牌元數據,我需要提供兩個值: _tokenId (uint256)_preferredTransport (string).

有什麼可能的價值_preferredTransport

看起來它已被棄用(不再使用)

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;
   }
}

如您所見,第二個輸入參數沒有名稱,並且沒有被使用。

引用自:https://ethereum.stackexchange.com/questions/82726