Starknet v4.0.0 docs - #233
Conversation
✅ Deploy Preview for openzeppelin-docs-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
stevep0z
left a comment
There was a problem hiding this comment.
Automated docs review — inline comments below.
| | [`ERC721Upgradeable`](/contracts-cairo/4.x/api/erc721#ERC721Upgradeable) | `{{ERC721UpgradeableClassHash}}` | | ||
| | [`ERC1155Upgradeable`](/contracts-cairo/4.x/api/erc1155#ERC1155Upgradeable) | `{{ERC1155UpgradeableClassHash}}` | | ||
| | [`EthAccountUpgradeable`](/contracts-cairo/4.x/api/account#EthAccountUpgradeable) | `{{EthAccountUpgradeableClassHash}}` | | ||
| | `MetaTransactionV0` | `{{MetaTransactionV0ClassHash}}` | |
There was a problem hiding this comment.
This preset has a class hash here but no documentation anywhere.
The preset is real — it ships as packages/presets/src/meta_tx_v0.cairo at v4.0.1 — so the hash is fine. But there's no page for it, no API entry, no nav entry, and it's the only row in this table without a link. A reader can copy this hash and deploy it without knowing what it does.
It also isn't a general-purpose preset. The upstream source says the syscall replaces the signature with one the caller supplies, sets the caller to the OS (address 0), and drops the transaction version to 0 — with this note:
NOTE: This syscall should only be used to allow support for old version-0 bound accounts, and should not be used for other purposes.
None of that reaches the reader today. Either add a short page, or at minimum link the row to the source and carry that note across. If the page isn't ready, dropping the row until it is would also be fine.
Tracked in #236.
| }; | ||
| ``` | ||
|
|
||
| The generated implementation uses `EventSpy`, `ExpectedEvent`, and their assertion extensions, so bring the corresponding `openzeppelin_testing` types and traits into scope in the test module. |
There was a problem hiding this comment.
EventSpy isn't an openzeppelin_testing type, so this points people at the wrong package.
EventSpy comes from Starknet Foundry. The openzeppelin_testing::events module at v6.7.0 — the version this page's own api/testing.mdx pins — exports EventSpyQueue, EventSpyExt, ExpectedEventTrait, EventSpyQueueDebug and spy_events, plus an ExpectedEvent impl. Someone searching that package for EventSpy finds nothing.
There's also no use openzeppelin_testing example anywhere in the 4.x docs, so "bring the corresponding types into scope" leaves the reader nothing to copy.
Please replace the sentence with the actual use line. I confirmed those names exist in v6.7.0, but not which exact set the generated code needs — that should come from you.
| The [ERC1155SupplyComponent](/contracts-cairo/4.x/api/erc1155#ERC1155SupplyComponent) tracks the supply of each token ID, the aggregate supply across all IDs, and whether a token ID exists. It implements `IERC1155Supply` through `total_supply`, `total_supply_all`, and `exists`. | ||
|
|
||
| <Callout type='warn'> | ||
| Do not add `ERC1155SupplyComponent` when upgrading an already deployed ERC1155 contract: existing balances would not be reflected in its newly initialized counters. For new deployments, forward every mint, burn, and transfer to `ERC1155SupplyComponent::after_update` from `ERC1155HooksTrait::after_update`, or the recorded supply will be incorrect. |
There was a problem hiding this comment.
This says the hook wiring is mandatory but doesn't show it.
Same gap in two more places: erc721.mdx:221 (ERC721ConsecutiveComponent, before_update/after_update) and erc721.mdx:237 (ERC721URIStorageComponent::after_update).
If someone gets this wrong, nothing fails loudly — supply, ownership, or URI state just goes quietly wrong. That's exactly where prose alone isn't enough.
This PR already does it well for ERC-6909 at erc6909.mdx:292-305. Copying that shape into these three sections would close it.
Not blocking. Tracked in #236.
Review: no blockersReviewed this for structure, developer experience, and writing. Nothing here blocks the merge. What this PR actually isA 4.x version bring-up for Cairo. The +22k line count overstates it: 4.x is largely a copy of 3.x with targeted changes. Six pages are byte-identical to their 3.x versions, and most of the rest differ only in link version numbers. The genuinely new writing is about 525 lines, mostly ERC-6909 and the migration guide. I reviewed it on that basis rather than as a from-scratch ecosystem. Checked and clean
Worth calling outERC-6909 is the best-documented new surface here. And the migration section at CommentsThree inline. Only one asks for a change: Deliberately not raised hereThere's a set of older problems in this area — broken anchors, onchain spelling, and a link checker that already exists but never runs on pull requests. They're present in 2.x and 3.x too, so holding this PR for them would be the wrong call. Tracked in #236. |
stevep0z
left a comment
There was a problem hiding this comment.
Looks good. Thanks for this! I've left a couple of comments, only one of which would be good to update within this PR. It can be resolved in a refactor PR though for the docs in general as it is minor.
No description provided.