Conversation
WalkthroughThe PR extends the macro system to support ERC20Wrapper and ERC721Wrapper components by adding enum variants, deserialization logic, and metadata. It also introduces validation checks for hook requirements in ERC1155Supply and ERC721Enumerable components, along with comprehensive test coverage and mock contract updates to use the new macro annotations. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
🧪 Cairo Contract Size Benchmark DiffBYTECODE SIZE (felts) (limit: 81,920 felts)No changes in felts. SIERRA CONTRACT CLASS SIZE (bytes) (limit: 4,089,446 bytes)No changes in bytes. This comment was generated automatically from benchmark diffs. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/macros/src/attribute/with_components/components.rs`:
- Around line 267-284: The ComponentInfo metadata for
AllowedComponents::ERC20Wrapper and AllowedComponents::ERC721Wrapper is
incorrect: update the ComponentInfo 'event' field to reflect actual component
definitions—for AllowedComponents::ERC20Wrapper (ERC20WrapperComponent) set
event to "Event" to match the enum name defined in ERC20 wrapper, and for
AllowedComponents::ERC721Wrapper (ERC721WrapperComponent) either remove the
'event' field entirely from that ComponentInfo or add a matching #[event] enum
to the ERC721 component; adjust only the ComponentInfo entries (in the
ComponentInfo initializer for ERC20WrapperComponent and ERC721WrapperComponent)
so metadata and component symbols align.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1635 +/- ##
=======================================
Coverage 93.74% 93.74%
=======================================
Files 88 88
Lines 2190 2190
=======================================
Hits 2053 2053
Misses 137 137 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
| AllowedComponents::ERC1155Supply => { | ||
| let hook_called = code.contains("erc1155_supply.after_update(") | ||
| || code.contains("ERC1155SupplyInternalImpl::after_update("); | ||
| if !hook_called { | ||
| let warning = Diagnostic::warn(warnings::ERC1155_SUPPLY_HOOKS_MISSING); | ||
| warnings.push(warning); | ||
| } | ||
| } |
Summary by CodeRabbit
New Features
Bug Fixes & Validation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.