Skip to content

feat: add score-gated DOS domain policy - #6

Merged
JOY (JOY) merged 1 commit into
dosfrom
codex/dos-domain-policy-testnet
Aug 22, 2026
Merged

feat: add score-gated DOS domain policy#6
JOY (JOY) merged 1 commit into
dosfrom
codex/dos-domain-policy-testnet

Conversation

@JOY

Copy link
Copy Markdown

Summary

  • Add EIP-712 score-gated claim, renewal, and reclaim policy for .dos names.
  • Add an access-controlled registrar and a Testnet 3939 deployment script that hands off registrar and renew roles from the legacy public registrar.
  • Dynamically discover registrars in the BENS-compatible subgraph.

Validation

  • forge test --match-path test/unit/registrar/DosDomainPolicy.t.sol (23 passing)
  • forge test --match-path test/unit/registrar/ETHRegistrar.t.sol (36 passing)
  • Subgraph Matchstick tests, manifest tests, codegen, and build (31 + 9 passing)

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a score-gated domain policy and a policy-controlled registrar (DOSPolicyRegistrar and DosDomainPolicy) for .dos domain registrations on the DOS Testnet, integrating EIP-712 voucher validation. It also updates the subgraph to dynamically discover and index these new registrar sources. The review feedback suggests a gas optimization in DosDomainPolicy.sol's label validation loop by skipping the first and last characters, which are already verified as alphanumeric.

Comment on lines +470 to +475
for (uint256 i; i < length; ++i) {
bytes1 character = value[i];
if (character != "-" && !_isAlphaNumeric(character)) {
revert InvalidLabel(label);
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The loop in _validateLabel currently iterates over the entire label length, checking every character. However, the first character (value[0]) and the last character (value[length - 1]) are already validated to be alphanumeric on line 466. We can optimize this loop to start at index 1 and end at length - 1 to avoid redundant checks and save gas on every label validation.

        for (uint256 i = 1; i < length - 1; ++i) {
            bytes1 character = value[i];
            if (character != "-" && !_isAlphaNumeric(character)) {
                revert InvalidLabel(label);
            }
        }

@JOY
JOY (JOY) force-pushed the codex/dos-domain-policy-testnet branch from ac1e562 to fb73205 Compare August 22, 2026 05:35
@JOY
JOY (JOY) merged commit fb4ca9b into dos Aug 22, 2026
7 checks passed
@JOY
JOY (JOY) deleted the codex/dos-domain-policy-testnet branch August 22, 2026 05:43
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.

1 participant