Pull Request: Add EIP-6047: Mandate emitting Transfer for ERC721 by xinbenlv · Pull Request #6047 · ethereum/EIPs · GitHub
eip: 6047
title: Extend ERC-721 to Support balance counting via Transfer event
description: Mandate emitting Transfer event for EIP-721 NFTs regardless whether minting / transferring occurs during or outside of contract creation.
author: Zainan Victor Zhou (@xinbenlv)
discussions-to: EIP-6047: Extend ERC-721 to Support balance counting via Transfer event
status: Draft
type: Standards Track
category: ERC
created: 2022-11-26
requires: 721
Abstract
EIP-721 requires Transfer
event to be emitted whenever a transfer or mint(i.e. transfer from 0x0
) or burn (i.g. transfer to 0x0
) occurs, EXCEPT for when during Contract creation. This EIP instead MANDATES compliant contract to ALWAYS emit Transfer
event regardless whether such transfer occurs in or outside of contract creation.
Motivation
EIP-721 requires Transfer
event to be emitted whenever a transfer or mint(i.e. transfer from 0x0
) or burn (i.g. transfer to 0x0
) occurs, EXCEPT for when during Contract creation. Due to this exception granted in EIP-721 standard, compliant contracts could mint NFTs during contract creation without event being emitted. Unlike EIP-721, the EIP-1155 standard mandates event to be emitted regardless of whether such minting occurs during or outside of contract creation. This allows a indexing service or any off-chain service to reliably capture and account for token creation.
This EIP removes said exception granted by EIP-721 and mandate emitting Transfer for EIP-721 during contract creation and thus all indexers and off-chain applications can account for token minting, burning and transferring only relying on EIP-721 Transfer event streams.
Specification
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119 and RFC 8174.
- Compliant contract MUST implement EIP-721
- Compliant contract MUST emit
Transfer
event to be emitted whenever a token transfer or mint(i.e. a token transfer from0x0
) or burn (i.g. transfer to0x0
) occurs, except for when during Contract creation, regardless of whether such transfer, mint or burn occurs during or outside of contract creation.
Rationale
- To allow accounting for minting during contract creation, there is also option to just create and emit new event type such as,
Creation
, instead of emitting the sameTransfer
. We choose not to go with such option, but instead just strengthening the EIP-721 requirement, which maximize the backwards compatibility.
Backwards Compatibility
This EIP is designed to be fully backward compatible with EIP-721.
Security Considerations
No new security concern is introduced.
Copyright
Copyright and related rights waived via CC0.