We deployed a ERC721 token using openzeppelin-solidity 1.9 and 0.4.25 solidity. We are currently writing a new smart contract using solidity 0.5.4. We are using IERC721 interface and interacting with deployed ERC721 contract. We are specifically calling ownerOf and getApproved calls on the token contract. The contract written in 0.5 solidity can interact with a token contract deployed in 0.5. However when we interact with a token contract deployed with 1.9 open zeppelin on solidity 0.4 we get 0x00 for owner and getApproved calls. tokenURI also returns empty string.
Looks like the contract isnt calling the token contract at all. We even wrote an interoperability interface.
pragma solidity >0.4.99 <0.6.0;
interface IERC721 {
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(address from, address to, uint256 tokenId) external;
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
function transferFrom(address from, address to, uint256 tokenId) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
Figured out the issue. I need to add the new token contract as approved contract in a registry to make that call. So this is resolved. Appreciate your time @abcoathup.