Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article explains ERC-6047, a proposal requiring events to be emitted when NFTs are minted during contract deployment.

The following specification is the basis for this explanation.

For other Ethereum improvement proposals, see the following page.

Overview

ERC-6047 extends ERC-721 by requiring the Transfer event to be emitted during contract creation, making NFTs easier to track and index.

ERC-721 requires a Transfer event when an NFT is transferred, minted (a transfer from the zero address, 0x0), or burned (a transfer to the zero address). However, it permits NFTs to be created during contract deployment without emitting this event.

ERC-6047 removes that exception by requiring a Transfer event for these initial mints as well.

Motivation

Under the ERC-721 specification, minting normally requires a Transfer event, but minting during contract creation is an exception. An implementation can therefore create NFTs at deployment without producing the logs an indexer would normally observe.

By contrast, ERC-1155 requires mint events even during contract creation. Indexers and other off-chain services can track ERC-1155 mints from these events, whereas ERC-721 NFTs created without deployment-time events may be missed.

Requiring deployment-time events provides the following benefits.

  • Consistent records for NFT mints, transfers, and burns.
  • More reliable discovery of ERC-721 tokens by indexers.
  • Improved data consistency for off-chain applications.

Specification

Contracts conforming to ERC-6047 must meet the following requirements.

  • Implement ERC-721.
  • Emit a Transfer event when an NFT is transferred, minted (from 0x0), or burned (to 0x0).
  • Emit a Transfer event for every NFT minted during contract creation.

Additional Considerations

Rather than introducing a new event such as Creation, ERC-6047 uses the existing Transfer event to preserve compatibility with existing indexing services.

A new event would require additional development by indexers and off-chain applications. Extending the circumstances under which the existing event must be emitted allows these services to continue using their existing event-processing logic and minimizes the impact of the change.

Backward Compatibility

All contracts conforming to ERC-6047 also conform to ERC-721. However, not every ERC-721 contract conforms to ERC-6047.

Citation

Zainan Victor Zhou (@xinbenlv), "ERC-6047: ERC-721 Balance indexing via Transfer event [DRAFT]," Ethereum Improvement Proposals, no. 6047, November 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-6047.

Conclusion

ERC-6047 makes deployment-time NFT mints observable through the same Transfer events used throughout the ERC-721 token lifecycle.