How to access `data` parameter in ERC1155

When this parameter is used, is there any easy method for accessing that data or does it required digging in chain logs? Ideally, i’m hoping it is as accessible as checking a balance at an address.

2 Likes

Hi @Garrett_C,

If you have a look at the _mint code, it would be up to you how to implement when extending.

You could use the _beforeTokenTransfer hook (https://docs.openzeppelin.com/contracts/3.x/extending-contracts#using-hooks) to perhaps emit an event, you could then use an offchain service such as The Graph, or use OpenZeppelin Defender Sentinel (https://docs.openzeppelin.com/defender/sentinel) to then use the data