Skip to content

Add LabelStore#260

Open
adraffy wants to merge 3 commits intodevelopfrom
feat/labelstore
Open

Add LabelStore#260
adraffy wants to merge 3 commits intodevelopfrom
feat/labelstore

Conversation

@adraffy
Copy link
Copy Markdown
Member

@adraffy adraffy commented Apr 1, 2026

  • added ILabelStore
    • added event Label(bytes32 labelHash, string label)
  • added LabelStore
    • added setLabel(label) and getLabel(anyId) returns (label)
  • added tests
  • updated PermissionedRegistry, UserRegistry, and related constructors
  • updated devnet

  • did not modify events — decided against
  • did not change setParent() — decided against

@TateB
Copy link
Copy Markdown
Member

TateB commented Apr 9, 2026

@codex

@adraffy adraffy changed the base branch from main to develop April 9, 2026 21:31
@adraffy adraffy marked this pull request as ready for review April 9, 2026 21:31
@adraffy adraffy requested a review from TateB April 9, 2026 21:32
@immunefi-magnus
Copy link
Copy Markdown

🛡️ Immunefi PR Reviews

We noticed that your project isn't set up for automatic code reviews. If you'd like this PR reviewed by the Immunefi team, you can request it manually using the link below:

🔗 Send this PR in for review

Once submitted, we'll take care of assigning a reviewer and follow up here.

Copy link
Copy Markdown

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

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: ef3da8a278

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

address ownerAddress,
uint256 ownerRoles
) HCAEquivalence(hcaFactory) MetadataMixin(metadata) {
LABEL_STORE = labelStore;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Enforce a contract label store in constructor

register() now relies entirely on LABEL_STORE.setLabel(label) for label-size validation, but the constructor stores labelStore without checking that it is a deployed contract. If this is misconfigured to address(0) or an EOA, the external call succeeds as a no-op and empty/oversized labels stop reverting (a regression from the previous in-contract NameCoder.assertLabelSize check), so registration invariants silently weaken in those deployments.

Useful? React with 👍 / 👎.


assertEq(labelStore.getLabel(LibLabel.withVersion(labelId, version)), "", "before");

vm.expectEmit();
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 Replace expectEmit with log inspection in new event tests

The new event assertion uses vm.expectEmit, but the repository guideline in /workspace/contracts-v2/AGENTS.md explicitly requires vm.recordLogs with explicit log checks for event testing. Keeping expectEmit here risks under-specified assertions (e.g., emitter/topic matching pitfalls) and violates the project’s mandated testing pattern for event correctness.

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