Add "data" parameter to all mint/transfer methods #75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When performing token transfers, it's often beneficial to include additional data alongside the transfer. This can be to indicate the reason for the transfer, to tie it to an off-chain transaction, or to provide special instructions to derived token variants without altering the original contract interface.
One way to achieve this is by adding a
bytes data
parameter to the method signature, which is common in the Ethereum community and was codified in ERC-5750. Many existing standards, including ERC-721, ERC-1155, and ERC-1400 (specifically the ERC-1594 component) all conform to this pattern.I'd like to propose that Zeto also adopt this pattern and add
bytes data
to each of its mint/transfer methods and events. This does represent a change to the signatures.Note: There are other ways to allow similar functionality without changing the existing signatures (such as with method overloading, or emitting multiple events instead of only one) - but in my opinion the proposed route would be the cleanest and most consistent with other current token standards.