Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

RogerPodacter/ERC721OZOptimized

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is deprecated

Just use https://github.com/Vectorized/solady/blob/main/src/tokens/ERC721.sol

"Better OZ ERC721"

ERC721OZOptimized adds ERC721A-style data hitchhiking on to OpenZeppelin's ERC721 implementation.

ERC721OZOptimized limits token ids to uint64s (down from uint256s). Other than that, ERC721OZOptimized is functionally equivalent to OZ's implementation, but contains new functions to:

  1. Show you per-address mint and burn stats:
  • _numberMinted(address owner)
  • _numberBurned(address owner)
  1. Give you access to a uint64 of free address-level data:
  • _setAddressExtraData(address owner, uint64 extraData)
  • _getAddressExtraData(address owner):
  1. Give you access to a uint96 of free token-level data:
  • _setTokenExtraData(uint tokenId, uint96 extraData)
  • _getTokenExtraData(uint tokenId)

This is a proof of concept!

Other things you could do: add unchecked in various places. Add callbacks to set user / address data to save gas on double writes (like ERC721A). Test performance.

There is also a version with Diamond Storage (ERC721D)

It doesn't implement supportsInterface, you must do that yourself in another facet

About

A better version of OZ's ERC721 implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published