假设:721合约中A合约的token id类型是数字类型 1,2,3...,B合约中的tokenId是a,b,c...这样,现在我要写一个转账方法同时支持两种不同类型的tokenId进行转账,该怎样实现?核心问题在于操作转账时需要tokenId,而我不确定tokenId的类型,这个问题怎么处理?
function balanceOf(address _owner) external view returns (uint256);
function ownerOf(uint256 _tokenId) external view returns (address);
function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) external payable;
function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable;
function transferFrom(address _from, address _to, uint256 _tokenId) external payable;
function approve(address _approved, uint256 _tokenId) external payable;
function setApprovalForAll(address _operator, bool _approved) external;
function getApproved(uint256 _tokenId) external view returns (address);
function isApprovedForAll(address _owner, address _operator) external view returns (bool);
erc721的标准中,tokenId 都是uint256的格式,所以a这样的估计是toHex(),变成十六进制了