Have a very basic ERC721 contract based on OpenZeppelin-Solidity, as follows:

pragma solidity ^0.5.7;

import 'openzeppelin-solidity/contracts/token/ERC721/ERC721Mintable.sol';
import 'openzeppelin-solidity/contracts/token/ERC721/ERC721Burnable.sol';
import 'openzeppelin-solidity/contracts/token/ERC721/ERC721Enumerable.sol';

contract NukeToken is ERC721Burnable, ERC721Mintable, ERC721Enumerable {
    uint8 public decimals = 18;

and, for (one of) the relevant functions:

     * @dev Gets the owner of the specified token ID.
     * @param tokenId uint256 ID of the token to query the owner of
     * @return address currently marked as the owner of the given token ID
    function ownerOf(uint256 tokenId) public view returns (address) {
        address owner = _tokenOwner[tokenId];
        require(owner != address(0));
        return owner;

After deploying the contract, nuketoken.functions.ownerOf(token_id).call() returns a BadFunctionCallOutput error, instead of an address. If I run this with .transact(), a tx_hash is returned as expected.

Your Answer

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

Browse other questions tagged or ask your own question.