Skip to content

Feat/legion conditions#115

Open
merisman wants to merge 66 commits into
developfrom
feat/legion-conditions
Open

Feat/legion conditions#115
merisman wants to merge 66 commits into
developfrom
feat/legion-conditions

Conversation

@merisman

@merisman merisman commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

merisman and others added 30 commits May 5, 2026 21:45
… Add tests against real CyberAgreementRegistry
…ry. Misc housekeeping to library interfaces & dependencies
…ger-secondary-trades

# Conflicts:
#	src/interfaces/ICyberCertPrinter.sol
Detoo and others added 26 commits June 29, 2026 18:39
fix: scripifying cert should respect reserved units
…nes, and unit reservation should be managed end-to-end by secondary transfer controller (aka deal manager) itself
…nal-audit

Fix/secondary trading internal audit

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9880b12a99

ℹ️ 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".

if (from == to) return;

if (from != address(0)) {
uint256 fromBalance = s.holderTokenCount[from] - 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Backfill holder counts before decrementing them

For printers upgraded with already-minted certificates, holderTokenCount starts at zero and there is no migration/backfill for it (the new backfillLegalOwners only populates the legal-owner enumeration). The first post-upgrade transfer or burn of any legacy token enters this branch with s.holderTokenCount[from] == 0, so 0 - 1 reverts under Solidity 0.8 checked arithmetic, blocking legacy certificate transfers and any pending deal finalization that tries to move a pre-upgrade escrowed cert.

Useful? React with 👍 / 👎.

Comment on lines +120 to +122
uint256 currentCount = usResidentOnlyCount
? _usResidentHolderCount(printer)
: printer.holderCount();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Count legal owners for holder-cap checks

When HolderCapCondition is configured with usResidentOnlyCount == false, this uses printer.holderCount(), but that count is maintained from ERC-721 custody changes rather than the legal-owner ledger. In administered hosting, executeSecondaryTransfer mints the NFT to adminMultisig while recording the buyer as legal owner, so many distinct investors behind one custodian are counted as a single holder and the ICA holder cap can be exceeded.

Useful? React with 👍 / 👎.

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