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

feat(smart-contracts): owners count excludes the zero address #14828

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

clemsos
Copy link
Member

@clemsos clemsos commented Oct 9, 2024

Description

When a key is transferred to the zero address, the counter of unique owner should decrease

Issues

Fixes #13685
Refs #

Checklist:

  • 1 PR, 1 purpose: my Pull Request applies to a single purpose
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the docs to reflect my changes if applicable
  • I have added tests (and stories for frontend components) that prove my fix is effective or that my feature works
  • I have performed a self-review of my own code
  • If my code involves visual changes, I am adding applicable screenshots to this thread

Release Note Draft Snippet

@cla-bot cla-bot bot added the cla-signed label Oct 9, 2024
@clemsos clemsos changed the title feat(smart-contracts)Owners count exclude zero address feat(smart-contracts): owners count excludes the zero address Oct 9, 2024
@julien51
Copy link
Member

julien51 commented Oct 9, 2024

Thanks! Also I think we should make it possible for the zero address to own more than the limit of token per address?

@@ -204,7 +204,7 @@ contract MixinKeys is MixinErrors, MixinLockCore {
_keys[tokenId] = Key(tokenId, expirationTimestamp);

// increase total number of unique owners
if (totalKeys(_recipient) == 0) {
if (totalKeys(_recipient) == 0 && _recipient != address(0)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

this may never actually happen as INVALID_ADDRESS is thrown when a key is created to the null address

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

Successfully merging this pull request may close these issues.

Change members counter in members list
2 participants