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

Discounts #33

Merged
merged 22 commits into from
Aug 23, 2024
Merged

Discounts #33

merged 22 commits into from
Aug 23, 2024

Conversation

mejango
Copy link
Contributor

@mejango mejango commented Aug 13, 2024

Description

Allow tier's to have a discountPercent, tunable by the collection's owner iff the tier doesn't have a flag indicating that it can't increase the discount.

Limitations & risks

Are there any trade-off or new vulnarbility surface based on theses changes?

Check-list

  • Tests are covering the new feature
  • Code is natspec'd
  • Code is linted and formatted
  • I have run the test locally (and they pass)
  • I have rebased to the latest main commit (and tests still pass)

Interactions

These changes will impact the following contracts:

  • Directly:

  • Indirectly:

@mejango mejango changed the title works Discounts Aug 19, 2024
JBStored721Tier storage storedTier = _storedTierOf[msg.sender][tierId];

// Parse the flags.
(,,,, bool cannotIncreaseDiscountPercent) = _unpackBools(storedTier.packedBools);
Copy link
Contributor

Choose a reason for hiding this comment

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

looks kinda crazy but in each of these unpack instances

( /* bool ignoredVar */, /* bool ignoredVar2 */, /* bool ignoredVar3 */, /* bool ignoredVar4 */, bool cannotIncreaseDiscountPercent) = _unpackBools(storedTier.packedBools);

is more readable and safe to me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeaahhhhhhh.

@mejango mejango merged commit 1242bbb into main Aug 23, 2024
3 checks passed
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