Skip to content
Lattice

ERC721Pausable

Git Source

Title: ERC721Pausable

Author: Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/extensions/ERC721Pausable.sol)

Stateless Diamond facet — ERC-721 whose token transfers can be paused.

Reuses the shared PausableLib pause state (no new storage or interface): the diamond also cuts the Pausable facet for the admin-gated pause()/unpause(). Under the 0.5.0 token hook model (D25, option (a)) the base ERC721Lib has no hook, so this facet REPLACES the base movement selectors it gates: transferFrom and both safeTransferFrom overloads. Differences from OpenZeppelin v5.6.1, which gates _update with whenNotPaused:

  • Only those three selectors are gated. A mint, burn or _transfer that another facet runs through ERC721Lib (an app facet, ERC721Burnable's burn, ERC721Wrapper's depositFor/withdrawTo/ onERC721Received) still runs while paused. A composing facet that must respect the pause calls PausableLib.checkNotPaused itself.
  • It replaces the same selectors as ERC721Enumerable and ERC721Votes, so it is mutually exclusive with them: one ERC-721 movement override per diamond (pinned by SelectorCompatibilityTest).
  • pause()/unpause() come from the Pausable facet, gated on DEFAULT_ADMIN_ROLE; OpenZeppelin leaves them to the deriving contract.

Notes:

  • lattice-version: 0.5.0
  • lattice-source: OpenZeppelin v5.6.1

Functions

transferFrom

Transfers tokenId from from to to, reverting IPausable.EnforcedPause while paused (replaces the base transferFrom).

function transferFrom(address from, address to, uint256 tokenId) public virtual;

Parameters

NameTypeDescription
fromaddress
toaddress
tokenIduint256

safeTransferFrom

Safely transfers tokenId, reverting IPausable.EnforcedPause while paused (replaces the base).

function safeTransferFrom(address from, address to, uint256 tokenId) public virtual;

Parameters

NameTypeDescription
fromaddress
toaddress
tokenIduint256

safeTransferFrom

Safely transfers tokenId with data, reverting IPausable.EnforcedPause while paused (replaces the base).

function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) public virtual;

Parameters

NameTypeDescription
fromaddress
toaddress
tokenIduint256
databytes

exportSelectors

ERC-8153 selector export: this facet's cuttable selectors, tightly packed (4 bytes each).

Excludes exportSelectors() itself (0x0ef22643) - it is never cut into a diamond. Order matches forge inspect ERC721Pausable methodIdentifiers (alphabetical by signature); kept in exact parity by ExportSelectorsParityTest. Chunks: safeTransferFrom(address,address,uint256) 0x42842e0e safeTransferFrom(address,address,uint256,bytes) 0xb88d4fde transferFrom(address,address,uint256) 0x23b872dd

function exportSelectors() external pure virtual returns (bytes memory selectors);

Returns

NameTypeDescription
selectorsbytes