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 summarizes seven ERC-721 extensions implemented by OpenZeppelin, based on an earlier article and a presentation at a study session.

The event details and recording are available here:

The presentation slides and detailed accompanying article are available below.

https://chaldene.net/erc721-extension

What is OpenZeppelin?

5.png

OpenZeppelin provides libraries for developing secure smart contracts. Developers can reuse existing implementations rather than writing every contract from scratch, improving development efficiency. Its contracts are widely used in NFT and ERC-20 token projects.

ERC-721 extensions

6.png

The presentation covers seven extensions, including both widely used modules and less familiar ones. Although implementations exist for all seven, some are easily overlooked.

For an introduction to ERC-721, see the following article. The illustrations in this article retain their original Japanese labels.

https://chaldene.net/erc721

ERC721Pausable

ERC721Pausable is a commonly used extension.

17.png

Its purpose is to suspend and resume NFT transfers.

18.png

A pause flag controls whether the relevant operations can execute. For example, following a security incident, authorized operators may pause transfers to limit further damage. The same pattern can be applied to other operations.

In OpenZeppelin's implementation, pausing also affects minting and burning. Applications must expose appropriately access-controlled pause and unpause functions.

ERC721Burnable

ERC721Burnable is another common extension.

20.png

It allows NFTs to be burned.

21.png

Burning destroys a token in the contract's ownership records. ERC-721 represents a burn by emitting a Transfer event with the zero address as the destination. This is not an ordinary transfer to the zero address, which standard ERC-721 transfers reject.

A burned NFT is no longer owned or transferable. One possible application is a redemption mechanism in which a user burns an existing NFT to receive a new one.

ERC721Consecutive

ERC721Consecutive is a less familiar extension.

23.png

It allows multiple NFTs to be minted together.

24.png

NFTs with consecutive token IDs can be issued in a batch, reducing minting gas costs. This particular batch-minting mechanism is restricted to contract construction, and the maximum batch size can be configured.

The default maximum batch size is 5,000. This is a per-batch limit, not an overall collection supply cap. It also helps maintain compatibility with off-chain indexers.

25.png

Why is consecutive batch minting restricted to construction?

The mechanism represents a consecutive range of token IDs compactly. Restricting it to construction simplifies ownership bookkeeping and allows the ERC-2309 ConsecutiveTransfer event to be used consistently with ERC-721 event requirements. Ordinary minting can still take place after deployment.

ERC721URIStorage

ERC721URIStorage is commonly used.

27.png

It allows URI information to be managed in the contract.

A URI identifies a resource and may specify where that resource can be accessed, for example through a URL.

28.png

The contract can associate individual NFTs with custom URI strings referring to their metadata.

https://wa3.i-3-i.info/word15688.html

The important distinction is that the URI is stored in contract state rather than necessarily being derived from a shared base URI.

29.png

ERC-721 already defines the optional metadata interface, including tokenURI. ERC721URIStorage provides a particular implementation that supports storing custom per-token URIs. ERC-721 itself does not prohibit custom or fully on-chain metadata, and storing a URI does not automatically store the referenced metadata on-chain.

This extension gives developers more flexibility in assigning metadata identifiers to individual NFTs.

ERC721Votes

ERC721Votes is another less familiar extension.

31.png

It supports delegation and tracking of voting power associated with NFTs.

32.png

By default, each NFT represents one voting unit. Holders can delegate their voting units to themselves or another address. Delegation activates the corresponding voting power.

33.png

Delegated voting power can then be used by a compatible governance system. Undelegated voting units do not contribute to an account's active voting power. The extension tracks voting power and its historical checkpoints; the actual proposal and voting logic belongs in a separate governance contract.

ERC721Royalty

ERC721Royalty is a widely recognized extension.

35.png

It provides standardized royalty information for NFT sales.

A royalty is a portion of secondary-sale proceeds designated for a creator or another recipient.

36.png

The royalty amount is calculated from the sale price and a configured fraction, such as 10%. A marketplace can use that information to implement royalty payments as part of its purchase process.

37.png

Does this enforce royalty payments?

No. ERC721Royalty implements the ERC-2981 royalty information interface, which reports the recipient and amount rather than transferring funds or enforcing payment. Whether a royalty is actually paid depends on the marketplace's implementation. A marketplace can settle the sale separately and perform an ordinary NFT transfer without paying the royalty.

Enforcing secondary-market royalties remained a subject of discussion at the time of the original article.

ERC721Wrapper

ERC721Wrapper is less widely known.

39.png

It allows a new token to represent an existing NFT.

40.png

Depositing an underlying NFT into the wrapper contract mints a wrapped NFT with the same token ID. This process is called wrapping. Burning the wrapped token through the withdrawal mechanism releases the underlying NFT.

41.png

The original presentation compares wrapping to a Japanese noodle press: an NFT enters one side and a different representation emerges from the other.

42.png

Potential applications include:

  • Wrapping an NFT used in a card game to obtain a representation usable in a role-playing game.
  • Wrapping an NFT as part of a rental system that uses a token to represent ownership.
  • Building a custom system that issues multiple equipment tokens against one deposited NFT.

These are application designs rather than capabilities guaranteed by the base wrapper. In particular, issuing multiple tokens or implementing rental rights requires additional logic.

Conclusion

This article summarized seven OpenZeppelin ERC-721 extensions based on the original article and study-session presentation. The discussion reflects the July 2023 context; consult the documentation for the OpenZeppelin version used in your project.

For a more detailed explanation, see:

https://chaldene.net/erc721-extension

Questions are welcome via Twitter @cardene777.