Hello, I’m new to the blockchain space and am trying to make a dApp with a team.
Currently, we want to make an ERC1155 token that adds the ‘_from’ address to some external database as well as the coin as metadata when ‘safeTransferFrom’ function is called.
So we copy pasted the IERC1155 implementation from here and are directly modifying ‘safeTransferFrom’ as well as the ‘safeBatchTransferFrom’ functions from IERC1155 so we can modify the metadata of the token.
Currently, we haven’t made any modifications but are running into some errors, and are wondering if we could do the same thing by creating a function that calls ‘safeTransferFrom’ or ‘safeBatchTransferFrom’, then if the transfer goes through, add the metadata to some database as well as modify the coin itself.
However we weren’t able to find any functions that would explicitly allow us to modify the metadata of the token, so we feel like we directly need to modify the functions in IERC1155.
How do we modify the metadata of tokens being transferred in ERC1155?
We want to keep the transaction history of the coin on-chain so that no one can tamper with what accounts used to have the account. We want to use a token to create a tamper-proof history of where the token has been.
Is there any way to edit the metadata of the coin every time the coin is transacted?
To get a transaction history you can get this from the emitted events TransferSingle and TransferBatch. These should be emitted for all minting, transferring and burning.
See the EIP for details: