Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4062e7640
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
src/CyberCertPrinter.sol
Outdated
| } | ||
|
|
||
| if (oldOwner != address(0)) { | ||
| s.legalHolderTokenCount[oldOwner] -= 1; |
There was a problem hiding this comment.
Prevent underflow when adjusting legacy holder counts
_updateLegalHolder assumes every nonzero owners[tokenId].ownerAddress already has a positive legalHolderTokenCount, but that is false right after upgrading existing printers (new counters start at zero) and after reusing a burned token id (the old owner is still stored). In those cases, s.legalHolderTokenCount[oldOwner] -= 1 underflows and reverts, so legal-owner-changing flows like transfer/assign/burn can become unusable for affected tokens.
Useful? React with 👍 / 👎.
…ing due to migrating live legacy contracts
Highlight
IssuanceManagerbecause the legal holder accounting is tightly integrated inCyberCertPrinter._update(). We have no choice but to deal withCyberCertPrinter's sizeTODO