Skip to content

General Question RE: ERC1155_BATCH_RECEIVED_VALUE #60

@curldapps

Description

@curldapps

Apologies in advance for the general question in the issues section, but I felt it is a simple enough query to not be a bother.

I wanted to get some help understanding the happy path for the contract recipient check during mint functions:

function _callonERC1155BatchReceived(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, uint256 _gasLimit, bytes memory _data) internal { // Pass data if recipient is contract if (_to.isContract()) { bytes4 retval = IERC1155TokenReceiver(_to).onERC1155BatchReceived{gas: _gasLimit}(msg.sender, _from, _ids, _amounts, _data); require(retval == ERC1155_BATCH_RECEIVED_VALUE, "ERC1155#_callonERC1155BatchReceived: INVALID_ON_RECEIVE_MESSAGE"); } }

I am not certain what input in bytes during mint and batchMint would allow me to distribute tokens to a contract address. I do not fully understand how this check works. I can see the set values in the ERC1155.sol contract state variables, but do not know what needs to be input in arguments for an actual mint to pass this check.

Any help would be appreciated :) I am 90% done with an implementation of ERC1155 that borrows from this repository's fantastic framework. Thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions