Name changes and read-only wrappers for consistency #284
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some changes to make the naming scheme consistent,
and make certain variables private with internal view getters for read-only access.
contracts/ERC721A.sol
Variable
_currentIndex
made private.Created
_nextTokenId()
internal view function to return the value instead.Variable
_burnCounter
made private.Created
_totalBurned()
internal view function to return the value instead.These variables are not intended for direct writing by deriving contracts.
The read-only functions are more consistent in naming with existing functions like
_totalMinted()
and_startTokenId()
.This also simplifies accessing the values with Diamond upgradeables
(users can simply call
_totalBurned()
instead ofERC721AUpgradable.storage()._burnCounter
).contracts/extensions/ERC721AOwnersExplicit.sol
Error
QuantityMustBeNonZero
renamed toInitializeZeroQuantity
.More consistent naming with other custom errors, such as
MintZeroQuantity
.Error
AllOwnershipsHaveBeenSet
renamed toAllOwnershipsInitialized
.Variable
nextOwnerToExplicitlySet
renamed to_currentIndexOwnersExplicit
and made private.Created
_nextTokenIdOwnersExplicit()
internal view function to return the value instead.Function
_setOwnersExplicit
renamed to_initializeOwnersExplicit
.More consistent naming with function
_initializeOwnershipAt
.Similarly, the variable is not intended for direct writing by deriving contracts.
Semantically, "initialize" is more appropriate than "set" for their intended use cases,
as users cannot decide on the values to be written.