I’m using ERC1155 based on ERC1155PresetMinterPauser. I Didn’t change anything from that implementation
How does mint function actually uses “data” argument? is that mandatory?, if yes ,why? what that “data” actually represents?
I see no references to that on mint function, or in _mint internal function, not even in the events emited during minting, notexplanation on comments… maybe I’m losing something, I just don’t understand what should we do with “data” here
The preset contract doesn't use the data parameter but passes it on. If you needed to pass additional data for mint and transfers then you could use data.
EIP-1155safeTransferFrom describes the data parameter as follows:
Additional data with no specified format, MUST be sent unaltered in call to onERC1155Received on _to
Thanks abcaoathup, so I see that basically _data parameter is just there to keep compliance with the standard most of all.
Can you provide some insight about why the standard enforce this? I mean the reasons why. I understand that a any particular deployment could overwrite this method and do something with that data, maybe as a way of using a tag for some minting transactions and just emitting enriched data events or something else... I mean, there is no enforced _data argument on erc20 or erc721 for e.g., this makes for example that any wallet or dapp or third party contract that will mint on erc1155 should be aware of adding void arguments when calling this function. Just like you do in GameItems contract constructing_an_erc1155_token_contract
What is actually the reason why the Preset-Contract ERC1155PresetMinterPauser does not use “_safeMint” instead of “_mint”? Shouldn’t we prefer the safeMint-methods over the conventional _mint-methods? And if not, what could be the reason for that?