Skip to content

ERC721Consecutive batch minting not enabled after construction #5621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
arr00 opened this issue Apr 2, 2025 · 2 comments
Open

ERC721Consecutive batch minting not enabled after construction #5621

arr00 opened this issue Apr 2, 2025 · 2 comments

Comments

@arr00
Copy link
Contributor

arr00 commented Apr 2, 2025

🧐 Motivation
The current implementation for ERC721Consecutive implements ERC-2309, enabling batch mints during the construction of the token; however, there are many use cases that require batch minting after construction. ERC721Consecutive falls back to a single mint function.

📝 Details

if (address(this).code.length > 0) {
revert ERC721ForbiddenBatchMint();
}

@ernestognw
Copy link
Member

ernestognw commented Apr 3, 2025

Concretely, this feature may be implemented as:

if (address(this).code.length > 0 && !NON_COMPLIANT_ALLOW_BATCH_MINT_AFTER_CONSTRUCTION()) {
    revert ERC721ForbiddenBatchMint();
}

...

/// @dev <some comment explaining devs can turn this on, but it would make the constract non ERC721 compliant
function NON_COMPLIANT_ALLOW_BATCH_MINT_AFTER_CONSTRUCTION() internal pure virtual returns (bool) { return false; }

So that developers can customize with:

function ALLOW_BATCH_MINT_AFTER_CONSTRUCTION() internal pure override returns (bool) { return true; }

@Amxx
Copy link
Collaborator

Amxx commented Apr 3, 2025

One of the risks that has to be considered/documented is that the range of batch mint done after construction may overlap with tokenIds minted using the "tranditional" _mint function. In that case we need to understand and document the behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants