[SOLVED] safeTransferFrom Function ERC-1155

I have an ERC-1155 Contract with the following override

function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes memory data) public override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );
        _safeTransferFrom(from, to, id, amount, data);
        resetSendHomeCountdown();
    }

within remix I try to use the following function with the following input:

safeTransferFrom(0x5B38Da6a701c568545dCfcB03FcB875f56beddC4, 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c, 1, 1, "") and it returns

transact to aeToken.safeTransferFrom errored: Error encoding arguments: Error: invalid arrayify value (argument="value", value="", code=INVALID_ARGUMENT, version=bytes/5.4.0)
>
  1. The Token ID is correct within the contract,
  2. At least 1 token is minted and displays on the “from address” with balanceOf

I think that you should convert those addresses to string and not to send them as numbers.
Like using “0x5B38Da6a701c568545dCfcB03FcB875f56beddC4” instead of 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4

I’ve tried and It does not work, or least doesn’t make a difference. Remix will automatically do it for your too.

if you remove this part then it works fine?
assuming that this is the only part that you added to the original function code.

No, the whole function does not work with or without the override. I can’t get it to work using the input (0x5B38Da6a701c568545dCfcB03FcB875f56beddC4, 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c, 1, 1, “”) whatso ever. It is deployed, there is at least 1 token in balance, the token_id is right,

I tested it in remix, it looks like you have to use [] instead of “” for last argument, like

safeTransferFrom(0x5B38Da6a701c568545dCfcB03FcB875f56beddC4, 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c, 1, 1, [])

Excellent, very much appreciate it!

The error message said, that an array was expected, but an empty string was given. :slight_smile:
It is bc _safeTransferFrom has expects an array as fourth input parameter.

Hey @Rainmaker

Please create a new topic and provide us as much info as possible :raised_hands:

1 issue = 1 topic