Skip to content

Commit

Permalink
Add EIP-6047: Extend ERC-721 to Support balance counting via Transfer…
Browse files Browse the repository at this point in the history
… event (ethereum#6047)

* Create EIP NFTC

* Get a number

* Mandate

* Update title

* Update text

* Update text

* Fix ERCs

* Fix ERCs

* Update EIPS/eip-6047.md

Co-authored-by: Pandapip1 <45835846+Pandapip1@users.noreply.github.com>

* Update EIPS/eip-6047.md

Co-authored-by: Pandapip1 <45835846+Pandapip1@users.noreply.github.com>

* Update EIPS/eip-6047.md

Co-authored-by: Pandapip1 <45835846+Pandapip1@users.noreply.github.com>

* Update EIPS/eip-6047.md

Co-authored-by: Pandapip1 <45835846+Pandapip1@users.noreply.github.com>

* Update EIPS/eip-6047.md

Co-authored-by: Pandapip1 <45835846+Pandapip1@users.noreply.github.com>

* Update EIPS/eip-6047.md

Co-authored-by: Pandapip1 <45835846+Pandapip1@users.noreply.github.com>

* Update EIPS/eip-6047.md

Co-authored-by: Pandapip1 <45835846+Pandapip1@users.noreply.github.com>

* Update wording for title and abstract

* Fix walidator & grammar issues

---------

Co-authored-by: Pandapip1 <45835846+Pandapip1@users.noreply.github.com>
Co-authored-by: Gavin John <gavinnjohn@gmail.com>
  • Loading branch information
3 people authored and axelcabee committed May 6, 2023
1 parent a63bf39 commit b56b3b4
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions EIPS/eip-6047.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
eip: 6047
title: ERC-721 Balance indexing via Transfer event
description: Mandates emitting the Transfer event for ERC-721 NFTs during contract creation
author: Zainan Victor Zhou (@xinbenlv)
discussions-to: https://ethereum-magicians.org/t/eip-xxx-require-erc721-to-always-emit-transfer/11894
status: Draft
type: Standards Track
category: ERC
created: 2022-11-26
requires: 721
---

## Abstract

This EIP extends [ERC-721](./eip-721.md) to allow the tracking and indexing of NFTs by mandating that a pre-existing event be emitted during contract creation.

ERC-721 requires a `Transfer` event to be emitted whenever a transfer or mint (i.e. transfer from `0x0`) or burn (i.g. transfer to `0x0`) occurs, **except during contract creation**. This EIP mandates that compliant contracts emit a `Transfer` event **regardless of whether it occurs during or after contract creation.**

## Motivation

[ERC-721](./eip-721.md) requires a `Transfer` event to be emitted whenever a transfer or mint (i.e. transfer from `0x0`) or burn (i.e. transfer to `0x0`) occurs, EXCEPT for during contract creation. Due to this exception, contracts can mint NFTs during contract creation without the event being emitted. Unlike ERC-721, the [ERC-1155](./eip-1155.md) standard mandates events to be emitted regardless of whether such minting occurs during or outside of contract creation. This allows an indexing service or any off-chain service to reliably capture and account for token creation.

This EIP removes this exception granted by ERC-721 and mandates emitting the `Transfer` for ERC-721 during contract creation. In this manner, indexers and off-chain applications can track token minting, burning, and transferring while relying only on ERC-721's `Transfer` event log.

## 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.

1. Compliant contracts MUST implement [ERC-721](./eip-721.md)
2. Compliant contracts MUST emit a `Transfer` event whenever a token is transferred, minted (i.e. transferred from `0x0`), or burned (i.g. transferred to `0x0`), **including during contract creation.**

## Rationale

Using the existing `Transfer` event instead of creating a new event (e.g. `Creation`) allows this EIP to be backward compatible with existing indexers.E

## Backwards Compatibility

All contracts compliant with this EIP are compliant with ERC-721. However, not all contracts compliant with ERC-721 are compliant with this EIP.

## Security Considerations

No new security concerns.

## Copyright

Copyright and related rights waived via [CC0](../LICENSE.md).

0 comments on commit b56b3b4

Please sign in to comment.