Skip to content
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

Owner limit bypass #1621

Open
wants to merge 7 commits into
base: add-wave-mint-event
Choose a base branch
from
Open

Conversation

wojciech-turek
Copy link
Member

Description

We have identified a couple issues that we had to address:

  • We should have a general limit of tokens per wallet that is independent of the wave limit
  • We want the owner to be able to mint over the wave and general limit for marketing events etc.
  • We don't want TSB special mints to be included in the waveTotalMinted as that limit should be for regular user mints

This PR contains the logic that is supposed to solve the above issues by:

  • Introducing maxTokensPerWallet measured in mintedCount per wallet
  • The minted count is increased when we use mint and waveMint but not batchMint which is the owner function.
  • We added extra errors and validation for example prevent admin from setting waveMaxTokensPerWallet higher than maxTokensPerWallet as that would make no sense.
  • It is acceptable that even if maxTokensPerWallet is 1 to have two waves with waveMaxTokensPerWallet set to 1 also as we may let users chose the mint wave.

Other changes:

  • Moved initialization params to a struct to avoid stack too deep error
  • Removed unnecessary data from WaveMint event

@wojciech-turek wojciech-turek requested a review from a team as a code owner January 15, 2025 13:55
@@ -102,6 +80,10 @@ contract NFTCollection is
* @notice stores the personalization mask for a tokenId
*/
mapping(uint256 => uint256) personalizationTraits;
/**
* @notice stores the number of tokens minted by an address
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minted by an address or minted for an address?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"minted by" is the correct one

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

Successfully merging this pull request may close these issues.

2 participants