Enforce Core UTF-8 metadata policy#127
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (21)
📝 WalkthroughWalkthroughThis PR implements production UTF-8 validation for ChangesStreamCore Production UTF-8 Enforcement
Sequence Diagram(s)sequenceDiagram
participant Caller
participant StreamCore
participant Renderer as StreamMetadataRenderer
participant Admin as IStreamAdmins
Caller->>StreamCore: addRandomizer(target)
StreamCore->>Renderer: requireContractMarker(target, selector, error)
Caller->>StreamCore: updateCollectionInfo(baseUri)
StreamCore->>Renderer: requireValidUtf8ContentUri(field, uri, max, allowEmpty)
Caller->>StreamCore: updateImagesAndAttributes(tokenId, imageUri, rawAttrs)
StreamCore->>Renderer: requireValidUtf8ContentUri(field, imageUri, max, allowEmpty)
StreamCore->>Renderer: requireValidUtf8RawAttributes(tokenId, field, rawAttrs, max)
Caller->>StreamCore: _onchainTokenURI(tokenId, data)
StreamCore->>Renderer: onchainTokenURIWithLimit(data, field, maxBytes)
Caller->>StreamCore: _requireMetadataMutationNotPaused()
StreamCore->>Renderer: requireNotPaused(adminsContract, pauseDomain, errorSelector)
Renderer->>Admin: isPaused(pauseDomain)
Admin-->>Renderer: bool
Renderer-->>StreamCore: revert or return
StreamCore-->>Caller: revert or continue
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
StreamCoreproduction metadata inputs by reusing linkedStreamMetadataRendererguard helpers.TokenNotMinted()for Core minted checks.Closes #125.
Size Evidence
StreamCore: 24,160 runtime bytes, 416 bytes of EIP-170 headroom.StreamMetadataRenderer: 10,442 runtime bytes after shared guard helpers.Local Verification
forge test --match-path test/StreamMetadataUtf8.t.sol -vvvforge test --match-path test/StreamCoreCustomErrors.t.sol -vvvforge test --match-path test/StreamMetadataUriPolicy.t.sol -vvvforge build --sizes --via-ir --skip test --skip script --forcemake release-checksumsmake checkscripts\check.ps1forge fmt --check smart-contracts/StreamCore.sol smart-contracts/StreamMetadataRenderer.sol test/StreamMetadataUtf8.t.sol test/StreamCoreCustomErrors.t.sol test/StreamMetadataUriPolicy.t.solgit diff --checkSummary by CodeRabbit
Release Notes
New Features
Improvements