Skip to content

Fix Starknet v4.0.1 docs - #237

Merged
bidzyyys merged 6 commits into
mainfrom
fix/cairo-4.x-docs-errors
Sep 4, 2026
Merged

bidzyyys merged 6 commits into
mainfrom
fix/cairo-4.x-docs-errors

Conversation

@immrsd

@immrsd immrsd commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #233, which landed the Starknet v4 docs. Fixes the defects review found in the merged pages, all of which are now live. 4.x only; one defect class per commit.

Broken example code — a markdown link path leaked into a macro arg (erc4626.mdx); the UniversalDeployerBootstrapper snippet opened 8 braces and closed 7, with get_udc_address dedented outside the impl (guides/deploy-udc.mdx); two imports that don't exist in v4 (udc.mdx, macros/with_components.mdx); the UDC address was a truncated 0x04..., i.e. the legacy UDC, and now comes from a single {{udc_address}} constant.

Wrong API signatures — 18 corrections against the cairo-contracts v4.0.1 sources, mostly in api/governance.mdx (missing voter / description_hash / proposal_id params, queue_operations' u64 return, CLOCK_MODE → ByteArray, executors: Span<ContractState> → Span<ContractAddress>). Elsewhere: the UDC preset's deploy_contract listed the ContractDeployed event fields as parameters, camelCase transferFrom lost amount, both __validate_deploy__ summaries showed (hash, signature), _token_royalty returned u256s, RoleAdminChanged's admin roles were typed ContractAddress, DefaultAdminDelayChangeCanceled had no entry at all (six links dangling), and the dual IERC20/IERC20Camel listings included the IERC20Metadata functions.

Rendering artifacts — literal \{id\} and stripped braces in api/erc1155.mdx, eight missing type colons, a token_id/tokenId mismatch, an Antora {ERC20Upgradeable-class-hash} leftover, four unbalanced escaped backticks, five backtick-wrapped links.

Anchors — 85 broken fragment links, now zero. 74 headings used [](#Some-Id)Heading, an empty link to an id rather than a definition of it, so the id was never emitted; they now use the Heading [#Some-Id] form used by the other 442 headings in the tree. The remaining 52 links were retargeted to ids that exist.

Stale pins — sncast v0.23.0 (May 2024) → v0.63.0, which required updating the commands: --url is no longer a pre-subcommand flag, --type is now required with --class-hash, and the fee wording changed. Also dropped a false callout claiming the JS examples need unreleased starknetjs@next features.

Verification — pnpm build (1049 pages) and pnpm lint:links clean; anchors 85 → 0; signatures diffed against the v4.0.1 sources; rendered HTML spot-checked for the new anchors, the {id} text and the replacement tokens.

Notes

  • src/lib/export-search-indexes.ts deserves a look from whoever owns search — untouched here. Its exclusion list uses bare version substrings ("/3.x/", "/4.x/"), so cairo 2.x stays indexed while 3.x is excluded, legacy overview pages leak in, one cairo carve-out line is dead, and a future "/5.x/" would silently drop Solidity's current docs.
  • Roughly 20 of the anchor bugs and several signature errors exist verbatim in 3.x and 2.x. Out of scope here since 4.x is latestStable; happy to retrofit separately.
  • Deliberately left alone: span<Call> casing at api/governance.mdx:264/:1633; the preset's undocumented deployContract and the related "replaced with" claim at udc.mdx:107; a second sncast pin at guides/deploy-udc.mdx:170; and stark.estimatedFeeToMaxFee at accounts.mdx:470, which starknet.js dropped after v6.

@immrsd
immrsd requested a review from a team as a code owner September 2, 2026 16:07
@netlify

netlify Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for openzeppelin-docs-v2 ready!

Name Link
🔨 Latest commit 2896b28
🔍 Latest deploy log https://app.netlify.com/projects/openzeppelin-docs-v2/deploys/6a9849d20f45c2000879cbaa
😎 Deploy Preview https://deploy-preview-237--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.

@immrsd
immrsd requested a review from ericnordelo September 2, 2026 16:09

@ericnordelo ericnordelo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@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.

LGTM. Thanks!

@bidzyyys
bidzyyys merged commit 0e772ef into main Sep 4, 2026
12 checks passed
@bidzyyys
bidzyyys deleted the fix/cairo-4.x-docs-errors branch September 4, 2026 07:44
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 4, 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.

4 participants