Skip to content

Starknet v4.0.0 docs - #233

Merged
stevep0z merged 2 commits into
mainfrom
feat/cairo-support-v4.0.0
Sep 1, 2026
Merged

stevep0z merged 2 commits into
mainfrom
feat/cairo-support-v4.0.0

Conversation

@ericnordelo

Copy link
Copy Markdown
Member

No description provided.

@ericnordelo
ericnordelo requested review from a team and stevep0z as code owners August 28, 2026 11:11
@netlify

netlify Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for openzeppelin-docs-v2 ready!

Name Link
🔨 Latest commit 3cc7e48
🔍 Latest deploy log https://app.netlify.com/projects/openzeppelin-docs-v2/deploys/6a9570cd9c53a60008f02a9e
😎 Deploy Preview https://deploy-preview-233--openzeppelin-docs-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ericnordelo
ericnordelo requested review from bidzyyys and immrsd August 28, 2026 11:49
@bidzyyys bidzyyys linked an issue Aug 28, 2026 that may be closed by this pull request

@stevep0z stevep0z left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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}}` |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@stevep0z

stevep0z commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Review: no blockers

Reviewed this for structure, developer experience, and writing. Nothing here blocks the merge.

What this PR actually is

A 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

  • Navigation is complete. 46 of 47 pages routed, no dangling entries. The one page not in nav is index, which matches how 3.x does it.
  • llms.txt is correct. 47 entries for 47 pages, with 3.x moved to Previous Versions.
  • Template variables all resolve, and api_source_version points at a real tag.
  • Version cutover is wired end to end, including the version-banner key fix from cairo-contracts to contracts-cairo. That key never matched the real URL, so the banner wasn't showing for Cairo at all before this.
  • The StarknetJS link change is right. The old domain now redirects to an unrelated company site.

Worth calling out

ERC-6909 is the best-documented new surface here. And the migration section at backwards-compatibility.mdx:7-44 names the exact removed constants, the exact new error string, and the new trait imports, and keeps the 4.0-prerelease-only changes separate. The reentrancy warning about external calls from a custom ownership implementation is a genuinely non-obvious catch.

Comments

Three inline. Only one asks for a change: MetaTransactionV0 sits in the presets table with a deployable class hash but has no documentation anywhere in the repo. The other two are suggestions.

Deliberately not raised here

There'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 stevep0z left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@stevep0z stevep0z changed the title Straknet v4.0.0 docs Starknet v4.0.0 docs Sep 1, 2026
@stevep0z
stevep0z merged commit 14f992e into main Sep 1, 2026
12 checks passed
@stevep0z
stevep0z deleted the feat/cairo-support-v4.0.0 branch September 1, 2026 18:48
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update docs for v4.0 stable release

2 participants