I am trying to call the function "ownerof" of a contract but it return me something like that : 0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000bc641d0c1acc8f85bb53aceade03bbc58de693d1

The function is :

    function updateRaceLeaderboard(
    uint256 raceID,
    uint256[] memory _leaderboard
) public onlyOwner returns (bytes memory addr) {
    RaceleaderBoard[raceID] = _leaderboard;
    address contractAddress = 0x80AFf21544b6670fCfD813134C83Bb340307c453;
    (bool success, bytes memory returndata) = contractAddress.call(
        abi.encodeWithSignature("ownerOf(uint256)", 0)
    return returndata;

I call it like that:

    dev = accounts.add(config["wallets"]["from_key"])
print("Working on " + network.show_active())
trx = race.updateRaceLeaderboard(
    {"from": dev},

The ownerOf(uint256) function is in a different contract at :


The success bool return True

Do you know how Can I receive a correct address ?

  • Can you provide more details of the caller and callee contracts? How are they related? What's ownerOf(uint256) implementation? Did it succeed? What's success value returned? My suspicious is that calee throw an exception.
    – Ismael
    Mar 29, 2022 at 4:57
  • No it did not success :(
    – user97483
    Mar 29, 2022 at 13:36
  • ownerOf(uint256) is a function of a ERC721 contract, you can saw it at : mumbai.polygonscan.com/address/…
    – user97483
    Mar 29, 2022 at 13:38

2 Answers 2


you need to decode the return data with abi.decode(returndata, (address))


In the comments you said it didn't succeed then it is not return an address but an error message

The error could be interpreted as


The 08c379a0 is a error signature Error(string)

Decoding the string messgae 4552433732313a206f776e657220717565 it gives

ERC721: owner que

My guess is that corresponds to

function ownerOf(uint256 tokenId) public view virtual override returns (address) {
    return _tokenOwners.get(tokenId, "ERC721: owner query for nonexistent token");

My second guess is that you shouldn't be using delegatecall, but call or staticcall instead.

Example how to parse the returned data

(bool success, bytes memory returndata) = contractAddress.call(
    abi.encodeWithSignature("ownerOf(uint256)", 0)

if (success) {
    (address owner) = abi.decode(returndata, (address));
    return owner;
  • When I use call success value is true and the returndata is : 0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000bc641d0c1acc8f85bb53aceade03bbc58de693d1 It is better but why there are so many 0 before ?
    – user97483
    Mar 29, 2022 at 13:57
  • @user97483 I've no idea because you haven't showed how the call and returned data is being managed. My guess is that you have to apply JiamingLi answer. If you want something to be answered please provide a fully reproducible example.
    – Ismael
    Mar 29, 2022 at 14:58
  • Ok ! I edited my post with more information about the call. Thank you for help
    – user97483
    Mar 29, 2022 at 15:15
  • @user97483 Sorry, I forgot about this, I've updated the answer to include the whole code. It was as said by JiamingLi, use abi.decode to obtain the returned address.
    – Ismael
    Apr 21, 2022 at 5:21

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.