chiru-labs / ERC721A

https://ERC721A.org
MIT License
2.5k stars 840 forks source link

Preparation for efficient consecutive burns #447

Closed Vectorized closed 1 year ago

Vectorized commented 1 year ago

Right now, the code assumes that the slot after a burnt slot will always be initialized.

These code changes allow for efficient bulk burning by allowing the slots after a burnt slot to remain uninitialized: simply set the burn bit of the starting slot to true, and the rest of the uninitialized slots will be considered burnt.

For now, the batch burning logic is not included due to it's complexity. It is left to the developer to implement their batch burning logic.

This does not affect how the storage slots are written, and will not cause a breaking change. It simply makes the ownership reading logic able to handle lazy batch burning, which is a superset of what the current code can do.

Changes: