From f2ac3552cb09fc38ae31a4830a3b72aa852ec870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Thu, 25 Sep 2025 18:56:15 -0400 Subject: [PATCH 01/43] Add replacements for compact contracts --- content/contracts-compact/utils/constants.js | 2 + .../contracts-compact/utils/replacements.ts | 9 ++++ source.config.ts | 52 ++++++++++--------- 3 files changed, 38 insertions(+), 25 deletions(-) create mode 100644 content/contracts-compact/utils/constants.js create mode 100644 content/contracts-compact/utils/replacements.ts diff --git a/content/contracts-compact/utils/constants.js b/content/contracts-compact/utils/constants.js new file mode 100644 index 00000000..ea787a91 --- /dev/null +++ b/content/contracts-compact/utils/constants.js @@ -0,0 +1,2 @@ +export const COMPACT_COMPILER_VERSION = "0.24.0"; +export const COMPACT_LANGUAGE_VERSION = "0.16.0"; \ No newline at end of file diff --git a/content/contracts-compact/utils/replacements.ts b/content/contracts-compact/utils/replacements.ts new file mode 100644 index 00000000..6072127f --- /dev/null +++ b/content/contracts-compact/utils/replacements.ts @@ -0,0 +1,9 @@ +import { COMPACT_COMPILER_VERSION, COMPACT_LANGUAGE_VERSION } from "./constants"; + +export const REPLACEMENTS = { + include: ['**/content/contracts-compact/**/*.mdx'], + replacements: { + compact_compiler_version: COMPACT_COMPILER_VERSION, + compact_language_version: COMPACT_LANGUAGE_VERSION + } +} diff --git a/source.config.ts b/source.config.ts index a1a011b8..5c556bd2 100644 --- a/source.config.ts +++ b/source.config.ts @@ -4,37 +4,39 @@ import rehypeKatex from "rehype-katex"; import { remarkMdxMermaid } from "fumadocs-core/mdx-plugins"; import remarkReplace from "@/lib/remark-replace"; import { REPLACEMENTS as cairoContractReplacements } from "content/contracts-cairo/utils/replacements"; +import { REPLACEMENTS as compactContractReplacements } from "content/contracts-compact/utils/replacements"; // You can customise Zod schemas for frontmatter and `meta.json` here // see https://fumadocs.vercel.app/docs/mdx/collections#define-docs export const docs = defineDocs({ - dir: "content", - // Async mode - enables runtime compilation for faster dev server startup - docs: { - async: true, - }, - // To switch back to sync mode (pre-compilation), comment out the docs config above and uncomment below: - // (sync mode - pre-compiles all content at build time) - // No additional config needed for sync mode - just remove the docs config + dir: "content", + // Async mode - enables runtime compilation for faster dev server startup + docs: { + async: true, + }, + // To switch back to sync mode (pre-compilation), comment out the docs config above and uncomment below: + // (sync mode - pre-compiles all content at build time) + // No additional config needed for sync mode - just remove the docs config }); export default defineConfig({ - mdxOptions: { - rehypeCodeOptions: { - fallbackLanguage: "plaintext", - themes: { - light: "github-light", - dark: "github-dark", - }, - }, - remarkPlugins: [remarkMath, remarkMdxMermaid, + mdxOptions: { + rehypeCodeOptions: { + fallbackLanguage: "plaintext", + themes: { + light: "github-light", + dark: "github-dark", + }, + }, + remarkPlugins: [remarkMath, remarkMdxMermaid, [ - remarkReplace, - [ - cairoContractReplacements, - ] - ], - ], - rehypePlugins: (v) => [rehypeKatex, ...v], - }, + remarkReplace, + [ + cairoContractReplacements, + compactContractReplacements + ] + ], + ], + rehypePlugins: (v) => [rehypeKatex, ...v], + }, }); From 002523ed74a6e4dfd56a9afd59a21d42a36b6f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Thu, 25 Sep 2025 18:56:44 -0400 Subject: [PATCH 02/43] Use newly defined replacement syntax --- content/contracts-compact/access.mdx | 6 +++--- content/contracts-compact/extensibility.mdx | 2 +- content/contracts-compact/fungibleToken.mdx | 4 ++-- content/contracts-compact/index.mdx | 10 +++++----- content/contracts-compact/multitoken.mdx | 4 ++-- content/contracts-compact/nonFungibleToken.mdx | 4 ++-- content/contracts-compact/ownable.mdx | 6 +++--- content/contracts-compact/security.mdx | 4 ++-- content/contracts-compact/utils.mdx | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/content/contracts-compact/access.mdx b/content/contracts-compact/access.mdx index 66f54a4a..0c4cfca9 100644 --- a/content/contracts-compact/access.mdx +++ b/content/contracts-compact/access.mdx @@ -50,7 +50,7 @@ Here’s a simple example of using `AccessControl` with [FungibleToken] to defin which allows accounts that have this role to create new tokens: ```ts -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import "./node_modules/@openzeppelin-compact/access-control/src/AccessControl" @@ -93,7 +93,7 @@ which can be implemented by defining _multiple_ roles. Let's augment our FungibleToken example by also defining a 'burner' role, which lets accounts destroy tokens. ```ts -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import "./node_modules/@openzeppelin-compact/access-control/src/AccessControl" @@ -169,7 +169,7 @@ and in fact it is also its own admin, this role carries significant risk. Let’s take a look at the FungibleToken example, this time taking advantage of the default admin role: ```ts -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import "./node_modules/@openzeppelin-compact/access-control/src/AccessControl" diff --git a/content/contracts-compact/extensibility.mdx b/content/contracts-compact/extensibility.mdx index 00f3f3e5..203a2eb5 100644 --- a/content/contracts-compact/extensibility.mdx +++ b/content/contracts-compact/extensibility.mdx @@ -51,7 +51,7 @@ As Compact matures, this pattern will likely evolve as well. ```ts // FungibleTokenMintablePausableOwnableContract -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import "./node_modules/@openzeppelin-compact/contracts/src/access/Ownable" diff --git a/content/contracts-compact/fungibleToken.mdx b/content/contracts-compact/fungibleToken.mdx index 5934a0f4..5cd0ad7a 100644 --- a/content/contracts-compact/fungibleToken.mdx +++ b/content/contracts-compact/fungibleToken.mdx @@ -49,7 +49,7 @@ Import the FungibleToken module into the implementing contract. It’s recommended to prefix the module with `FungibleToken_` to avoid circuit signature clashes. ```typescript -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import "./node_modules/@openzeppelin-compact/contracts/src/token/FungibleToken" @@ -90,7 +90,7 @@ export circuit decimals(): Uint<8> { The following example is a simple token contract with a fixed supply that’s minted to the passed recipient upon construction. ```typescript -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import "./node_modules/@openzeppelin-compact/contracts/src/token/FungibleToken" diff --git a/content/contracts-compact/index.mdx b/content/contracts-compact/index.mdx index 3747f0cf..e13d0664 100644 --- a/content/contracts-compact/index.mdx +++ b/content/contracts-compact/index.mdx @@ -8,7 +8,7 @@ title: Contracts for Compact [yarn]: https://yarnpkg.com/getting-started/install [compact-dev-tools]: https://docs.midnight.network/blog/compact-developer-tools -*A library for secure smart contract development* written in Compact for [Midnight]. +**A library for secure smart contract development** written in Compact for [Midnight]. This library consists of modules to build custom smart contracts. @@ -20,13 +20,13 @@ Expect rapid iteration. **Use at your own risk.** Make sure you have [nvm] and [yarn] installed on your machine. -Follow Midnight's [compact-dev-tools] installation guide and confirm that `compact` is in the `PATH` env variable. +Follow Midnight's [Compact Developer Tools][compact-dev-tools] installation guide and confirm that `compact` is in the `PATH` env variable. ```bash $ compact compile --version -Compactc version: 0.24.0 -0.24.0 +Compactc version: {{compact_compiler_version}} +{{compact_compiler_version}} ``` ### Installation @@ -66,7 +66,7 @@ Installing the library will be easier once it's available as an NPM package. ```typescript // MyContract.compact -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/Ownable" diff --git a/content/contracts-compact/multitoken.mdx b/content/contracts-compact/multitoken.mdx index 7346487d..a0281439 100644 --- a/content/contracts-compact/multitoken.mdx +++ b/content/contracts-compact/multitoken.mdx @@ -68,7 +68,7 @@ Import the MultiToken module into the implementing contract. It’s recommended to prefix the module with `MultiToken_` to avoid circuit signature clashes. ```typescript -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import "./node_modules/@openzeppelin-compact/multi-token/src/MultiToken" @@ -105,7 +105,7 @@ The following example is a simple multi-token contract that creates both a fixed ```typescript // MultiTokenTwoTokenTypes.compact -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import "./node_modules/@openzeppelin-compact/multi-token/src/MultiToken" diff --git a/content/contracts-compact/nonFungibleToken.mdx b/content/contracts-compact/nonFungibleToken.mdx index 7543d0bd..be2fdc7f 100644 --- a/content/contracts-compact/nonFungibleToken.mdx +++ b/content/contracts-compact/nonFungibleToken.mdx @@ -58,7 +58,7 @@ Import the NonFungibleToken module into the implementing contract. It’s recommended to prefix the module with `NonFungibleToken_` to avoid circuit signature clashes. ```typescript -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import "./node_modules/@openzeppelin-compact/non-fungible-token/src/NonFungibleToken" @@ -93,7 +93,7 @@ The following example is a simple non-fungible token contract that mints an NFT ```typescript // SimpleNonFungibleToken.compact -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import "./node_modules/@openzeppelin-compact/non-fungible-token/src/NonFungibleToken" diff --git a/content/contracts-compact/ownable.mdx b/content/contracts-compact/ownable.mdx index 6bc3c16b..86f46b20 100644 --- a/content/contracts-compact/ownable.mdx +++ b/content/contracts-compact/ownable.mdx @@ -49,7 +49,7 @@ Import the Ownable module into the implementing contract. It’s recommended to prefix the module with `Ownable_` to avoid circuit signature clashes. ```ts -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import "./node_modules/@openzeppelin-compact/ownable/src/Ownable" @@ -86,7 +86,7 @@ Here’s a complete contract showcasing how to integrate the Ownable module and ```ts // SimpleOwnable.compact -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import "./node_modules/@openzeppelin-compact/ownable/src/Ownable" @@ -321,7 +321,7 @@ It’s recommended to prefix the module with `ZOwnablePK_` to avoid circuit sign ```typescript // MyZOwnablePKContract.compact -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import "./node_modules/@openzeppelin-compact/contracts/src/access/ZOwnablePK" diff --git a/content/contracts-compact/security.mdx b/content/contracts-compact/security.mdx index 612d90f1..07cdbc8a 100644 --- a/content/contracts-compact/security.mdx +++ b/content/contracts-compact/security.mdx @@ -21,7 +21,7 @@ Many modules also use the initializable pattern which ensures that implementing ```ts // CustomContractStateSetup.compact -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import './node_modules/@openzeppelin-compact/contracts/src/security/Initializable'; @@ -68,7 +68,7 @@ For example (using the [Ownable] module for access control): ```ts // OwnablePausable.compact -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import './node_modules/@openzeppelin-compact/contracts/src/security/Initializable' diff --git a/content/contracts-compact/utils.mdx b/content/contracts-compact/utils.mdx index 2593e7b1..3ad193df 100644 --- a/content/contracts-compact/utils.mdx +++ b/content/contracts-compact/utils.mdx @@ -7,7 +7,7 @@ The Utils module provides miscellaneous circuits and common utilities for Compac ### Usage ```typescript -pragma language_version >= 0.16.0; +pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; import './node_modules/@openzeppelin-compact/utils/src/Utils' From fd9f9e994e80d53aecc76b3d53b0902f9d18f1bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Thu, 25 Sep 2025 23:48:23 -0400 Subject: [PATCH 03/43] Reorg Access pages --- src/navigation/midnight.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/navigation/midnight.json b/src/navigation/midnight.json index ef4f18c8..3c3954b7 100644 --- a/src/navigation/midnight.json +++ b/src/navigation/midnight.json @@ -35,13 +35,13 @@ "children": [ { "type": "page", - "name": "Access Control", - "url": "/contracts-compact/access" + "name": "Ownable", + "url": "/contracts-compact/ownable" }, { "type": "page", - "name": "Ownable", - "url": "/contracts-compact/ownable" + "name": "Access Control", + "url": "/contracts-compact/access-control" } ] }, From 75d8871cdf5f3e7f1ad8171d04502fb2c644b9c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Thu, 25 Sep 2025 23:48:48 -0400 Subject: [PATCH 04/43] Fix malformed link --- content/contracts-compact/ownable.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/contracts-compact/ownable.mdx b/content/contracts-compact/ownable.mdx index 86f46b20..c2f95002 100644 --- a/content/contracts-compact/ownable.mdx +++ b/content/contracts-compact/ownable.mdx @@ -3,7 +3,7 @@ title: Ownable --- {/* links */} -[initialize]: api/ownable#initialize +[initialize]: api/ownable#Ownable-initialize [transferOwnership]: api/ownable#Ownable-transferOwnership [_transferOwnership]: api/ownable#Ownable-_transferOwnership [_unsafeTransferOwnership]: api/ownable#Ownable-_unsafeTransferOwnership From 8f56682345d4a66d4ffc23b5ef1041cb0f4ea390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Thu, 25 Sep 2025 23:49:12 -0400 Subject: [PATCH 05/43] Add Access Control intro block --- content/contracts-compact/ownable.mdx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/content/contracts-compact/ownable.mdx b/content/contracts-compact/ownable.mdx index c2f95002..bc92c7a1 100644 --- a/content/contracts-compact/ownable.mdx +++ b/content/contracts-compact/ownable.mdx @@ -13,6 +13,13 @@ title: Ownable [ed25519]: https://ed25519.cr.yp.to/ [rfc6979]: https://datatracker.ietf.org/doc/html/rfc6979 +## Access Control Defined + +Access control—that is, "who is allowed to do this thing"—is incredibly important in the world of smart contracts. +The access control of your contract may govern who can mint tokens, vote on proposals, freeze transfers, and many other things. +It is therefore critical to understand how you implement it, lest someone else steals your whole system. +OpenZeppelin Contracts for Compact provides a variety of access control modules to suit your application and privacy needs. + ## Ownership and `Ownable` The most common and basic form of access control is the concept of ownership: From 73ac86473afa4041e3ab455fe1c416edfac41156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Thu, 25 Sep 2025 23:49:26 -0400 Subject: [PATCH 06/43] Add link --- content/contracts-compact/ownable.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/contracts-compact/ownable.mdx b/content/contracts-compact/ownable.mdx index bc92c7a1..01c7fa29 100644 --- a/content/contracts-compact/ownable.mdx +++ b/content/contracts-compact/ownable.mdx @@ -27,7 +27,7 @@ there’s an account that is the owner of a contract and can do administrative t This approach is perfectly reasonable for contracts that have a single administrative user. OpenZeppelin Contracts for Compact provides an Ownable module for implementing ownership in your contracts. -The initial owner must be set by using the initialize circuit during construction. +The initial owner must be set by using the [initialize] circuit during construction. This can later be changed with [transferOwnership]. ### Ownership transfers From 2f14f1cb91f998b981df31ac136ba52b8ce767ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Thu, 25 Sep 2025 23:49:41 -0400 Subject: [PATCH 07/43] Update imports --- content/contracts-compact/ownable.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/contracts-compact/ownable.mdx b/content/contracts-compact/ownable.mdx index 01c7fa29..27a6fe05 100644 --- a/content/contracts-compact/ownable.mdx +++ b/content/contracts-compact/ownable.mdx @@ -96,7 +96,7 @@ Here’s a complete contract showcasing how to integrate the Ownable module and pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; -import "./node_modules/@openzeppelin-compact/ownable/src/Ownable" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/Ownable" prefix Ownable_; /** @@ -331,7 +331,7 @@ It’s recommended to prefix the module with `ZOwnablePK_` to avoid circuit sign pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; -import "./node_modules/@openzeppelin-compact/contracts/src/access/ZOwnablePK" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/ZOwnablePK" prefix ZOwnablePK_; constructor( From 958964ece7b905c3bb2bf1287429c44d08d70fda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Thu, 25 Sep 2025 23:50:28 -0400 Subject: [PATCH 08/43] Update import --- content/contracts-compact/ownable.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/contracts-compact/ownable.mdx b/content/contracts-compact/ownable.mdx index 27a6fe05..e00e907a 100644 --- a/content/contracts-compact/ownable.mdx +++ b/content/contracts-compact/ownable.mdx @@ -59,7 +59,7 @@ It’s recommended to prefix the module with `Ownable_` to avoid circuit signatu pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; -import "./node_modules/@openzeppelin-compact/ownable/src/Ownable" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/Ownable" prefix Ownable_; constructor( From aa82fe3a2235c165da60b305350fc33b716c2e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Fri, 26 Sep 2025 00:05:56 -0400 Subject: [PATCH 09/43] Add additional links, fix formatting --- content/contracts-compact/ownable.mdx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/content/contracts-compact/ownable.mdx b/content/contracts-compact/ownable.mdx index e00e907a..d441f96d 100644 --- a/content/contracts-compact/ownable.mdx +++ b/content/contracts-compact/ownable.mdx @@ -9,6 +9,7 @@ title: Ownable [_unsafeTransferOwnership]: api/ownable#Ownable-_unsafeTransferOwnership [_unsafeUncheckedTransferOwnership]: api/ownable#Ownable-_unsafeUncheckedTransferOwnership [_computeOwnerId]: api/ownable#ZOwnablePK-_computeOwnerId +[assertOnlyOwner]: api/ownable#ZOwnablePK-assertOnlyOwner [ed25519]: https://ed25519.cr.yp.to/ [rfc6979]: https://datatracker.ietf.org/doc/html/rfc6979 @@ -270,7 +271,7 @@ const recoverableOwnerId = ZOwnablePK._computeOwnerId(publicKey, deterministicNo **Security Considerations** -The ZOwnablePK module remains agnostic to nonce generation methods, +The `ZOwnablePK` module remains agnostic to nonce generation methods, placing the security/convenience decision entirely with the user. Key considerations include: @@ -291,7 +292,7 @@ similar to how air-gapped systems are isolated from networks to prevent data lea #### The Privacy Enhancement -While ZOwnablePK provides cryptographic privacy through its commitment scheme, +While `ZOwnablePK` provides cryptographic privacy through its commitment scheme, operational security practices like using an AGPK provide an additional layer of protection against correlation attacks. Even with the strongest cryptographic commitments, reusing a public key across different on-chain activities can potentially compromise privacy through transaction pattern analysis. @@ -304,7 +305,7 @@ An Air-Gapped Public Key must adhere to strict isolation principles: has never generated any public key that appears in any on-chain transaction, across any blockchain network. The key material must be cryptographically pure. * **Never used elsewhere**: From the moment of AGPK generation until its destruction, -the private key material is used exclusively for this contract’s administrative functions (i.e. assertOnlyOwner). +the private key material is used exclusively for this contract’s administrative functions (i.e. [assertOnlyOwner]). No other public keys may ever be derived from or generated with the same key material. * **Never used again**: Users commit to destroying all copies of the private key material upon ownership renunciation or transfer. This relies entirely on user discipline and cannot be externally verified or enforced. @@ -354,7 +355,7 @@ export circuit renounceOwnership(): [] { } ``` -Similar to the Ownable module, +Similar to the [Ownable](#usage) module, circuits can be protected so that only the contract owner may them by adding `assertOnlyOwner` as the first line in the circuit body like this: ```typescript From c5c189b79addafdcf6f8a484ab126d12896b6333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Fri, 26 Sep 2025 11:13:03 -0400 Subject: [PATCH 10/43] Rename document, fix import paths, broken link --- .../{access.mdx => access-control.mdx} | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename content/contracts-compact/{access.mdx => access-control.mdx} (93%) diff --git a/content/contracts-compact/access.mdx b/content/contracts-compact/access-control.mdx similarity index 93% rename from content/contracts-compact/access.mdx rename to content/contracts-compact/access-control.mdx index 0c4cfca9..50269a72 100644 --- a/content/contracts-compact/access.mdx +++ b/content/contracts-compact/access-control.mdx @@ -9,7 +9,7 @@ title: Access Control [FungibleToken]: ./fungibleToken.mdx [Ownable]: ./ownable.mdx [Initializable]: ./security#initializable -[AccessControl]: api/accessControl.mdx#accessControl +[AccessControl]: api/access [assertOnlyRole]: api/access#AccessControl-assertOnlyRole [grantRole]: api/access#AccessControl-grantRole @@ -53,9 +53,9 @@ which allows accounts that have this role to create new tokens: pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; -import "./node_modules/@openzeppelin-compact/access-control/src/AccessControl" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/AccessControl" prefix AccessControl_; -import "./node_modules/@openzeppelin-compact/fungible-token/src/FungibleToken" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/FungibleToken" prefix FungibleToken_; export sealed ledger MINTER_ROLE: Bytes<32>; @@ -96,9 +96,9 @@ Let's augment our FungibleToken example by also defining a 'burner' role, which pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; -import "./node_modules/@openzeppelin-compact/access-control/src/AccessControl" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/AccessControl" prefix AccessControl_; -import "./node_modules/@openzeppelin-compact/fungible-token/src/FungibleToken" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/FungibleToken" prefix FungibleToken_; export sealed ledger MINTER_ROLE: Bytes<32>; @@ -172,9 +172,9 @@ Let’s take a look at the FungibleToken example, this time taking advantage of pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; -import "./node_modules/@openzeppelin-compact/access-control/src/AccessControl" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/AccessControl" prefix AccessControl_; -import "./node_modules/@openzeppelin-compact/fungible-token/src/FungibleToken" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/FungibleToken" prefix FungibleToken_; export sealed ledger MINTER_ROLE: Bytes<32>; From f02d50b155958c0fb6a3c6cb47641c1624d9b27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Fri, 26 Sep 2025 11:30:42 -0400 Subject: [PATCH 11/43] update import paths --- content/contracts-compact/security.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/contracts-compact/security.mdx b/content/contracts-compact/security.mdx index 07cdbc8a..af857de7 100644 --- a/content/contracts-compact/security.mdx +++ b/content/contracts-compact/security.mdx @@ -24,7 +24,7 @@ Many modules also use the initializable pattern which ensures that implementing pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; -import './node_modules/@openzeppelin-compact/contracts/src/security/Initializable'; +import './compact-contracts/node_modules/@openzeppelin-compact/contracts/src/security/Initializable'; export ledger _fieldAfterDeployment: Field; @@ -71,9 +71,9 @@ For example (using the [Ownable] module for access control): pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; -import './node_modules/@openzeppelin-compact/contracts/src/security/Initializable' +import './compact-contracts/node_modules/@openzeppelin-compact/contracts/src/security/Initializable' prefix Initializable_; -import './node_modules/@openzeppelin-compact/contracts/src/access/Ownable' +import './compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/Ownable' prefix Ownable_; constructor(initOwner: Either) { From ce7a1c0f2fac2f96ce6f4d122d0c162ad0053e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Fri, 26 Sep 2025 11:48:43 -0400 Subject: [PATCH 12/43] Update import paths, links --- content/contracts-compact/fungibleToken.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/contracts-compact/fungibleToken.mdx b/content/contracts-compact/fungibleToken.mdx index 5cd0ad7a..134a5e24 100644 --- a/content/contracts-compact/fungibleToken.mdx +++ b/content/contracts-compact/fungibleToken.mdx @@ -3,7 +3,7 @@ title: FungibleToken --- {/* links */} -[fungible tokens]: https://docs.openzeppelin.com/contracts/5.x/tokens#different-kinds-of-tokens +[fungible tokens]: ../contracts/5.x/tokens.mdx#different-kinds-of-tokens [EIP-20]: https://eips.ethereum.org/EIPS/eip-20 [Module/Contract Pattern]: ./extensibility.mdx#the_module_contract_pattern [_mint]: api/fungibleToken#FungibleToken-_mint @@ -52,7 +52,7 @@ It’s recommended to prefix the module with `FungibleToken_` to avoid circuit s pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; -import "./node_modules/@openzeppelin-compact/contracts/src/token/FungibleToken" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/FungibleToken" prefix FungibleToken_; constructor( @@ -93,7 +93,7 @@ The following example is a simple token contract with a fixed supply that’s mi pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; -import "./node_modules/@openzeppelin-compact/contracts/src/token/FungibleToken" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/FungibleToken" prefix FungibleToken_; constructor( From 25230f35ff34942376de4bce8019095dbb78f700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 11:43:25 -0400 Subject: [PATCH 13/43] Update import paths, url path --- content/contracts-compact/nonFungibleToken.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/contracts-compact/nonFungibleToken.mdx b/content/contracts-compact/nonFungibleToken.mdx index be2fdc7f..50c2f031 100644 --- a/content/contracts-compact/nonFungibleToken.mdx +++ b/content/contracts-compact/nonFungibleToken.mdx @@ -3,7 +3,7 @@ title: NonFungibleToken --- {/* links */} -[non-fungible tokens]: https://docs.openzeppelin.com/contracts/5.x/tokens#different-kinds-of-tokens +[non-fungible tokens]: ../contracts/5.x/tokens.mdx#different-kinds-of-tokens [EIP-721]: https://eips.ethereum.org/EIPS/eip-721 [ERC-165]: https://eips.ethereum.org/EIPS/eip-165 [Module/Contract Pattern]: ./extensibility#the-modulecontract-pattern @@ -61,7 +61,7 @@ It’s recommended to prefix the module with `NonFungibleToken_` to avoid circui pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; -import "./node_modules/@openzeppelin-compact/non-fungible-token/src/NonFungibleToken" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/NonFungibleToken" prefix NonFungibleToken_; constructor(name: Opaque<"string">, symbol: Opaque<"string">) { @@ -96,7 +96,7 @@ The following example is a simple non-fungible token contract that mints an NFT pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; -import "./node_modules/@openzeppelin-compact/non-fungible-token/src/NonFungibleToken" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/NonFungibleToken" prefix NonFungibleToken_; constructor( From 7c3f6a624a81a75bc477a6719b281b36011cba02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 11:44:10 -0400 Subject: [PATCH 14/43] Update import paths --- content/contracts-compact/api/access.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/contracts-compact/api/access.mdx b/content/contracts-compact/api/access.mdx index 249f31f7..faadcf06 100644 --- a/content/contracts-compact/api/access.mdx +++ b/content/contracts-compact/api/access.mdx @@ -10,7 +10,7 @@ The best way to achieve this is by using `export sealed ledger` hash digests tha ```typescript import CompactStandardLibrary; -import "./node_modules/@openzeppelin-compact/contracts/src/access/AccessControl" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/AccessControl" prefix AccessControl_; export sealed ledger MY_ROLE: Bytes<32>; @@ -55,7 +55,7 @@ implement the `Initializable` module and set `DEFAULT_ADMIN_ROLE` in the `initia [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/access/AccessControl.compact) ```ts -import "./node_modules/@openzeppelin-compact/contracts/src/access/AccessControl"; +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/AccessControl"; ``` --- From ef6e22095fbf49545f8d1af02e15943d7ba1081e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 11:44:33 -0400 Subject: [PATCH 15/43] update import paths --- content/contracts-compact/extensibility.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/contracts-compact/extensibility.mdx b/content/contracts-compact/extensibility.mdx index 203a2eb5..b8673cfe 100644 --- a/content/contracts-compact/extensibility.mdx +++ b/content/contracts-compact/extensibility.mdx @@ -54,11 +54,11 @@ As Compact matures, this pattern will likely evolve as well. pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; -import "./node_modules/@openzeppelin-compact/contracts/src/access/Ownable" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/Ownable" prefix Ownable_; -import "./node_modules/@openzeppelin-compact/contracts/src/security/Pausable" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/security/Pausable" prefix Pausable_; -import "./node_modules/@openzeppelin-compact/contracts/src/token/FungibleToken" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/FungibleToken" prefix FungibleToken_; constructor( From e5a31795aff08f612ae01e8aa4a0857581142db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 11:54:02 -0400 Subject: [PATCH 16/43] Fix formatting --- content/contracts-compact/multitoken.mdx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/content/contracts-compact/multitoken.mdx b/content/contracts-compact/multitoken.mdx index a0281439..ce32d72d 100644 --- a/content/contracts-compact/multitoken.mdx +++ b/content/contracts-compact/multitoken.mdx @@ -17,23 +17,23 @@ Even though Midnight is not EVM-compatible, this implementation attempts to be a Some features and behaviors are either not possible, not possible yet, or changed because of the vastly different tech stack and Compact language constraints. -***Notable changes*** +**Notable changes** -* ***`Uint<128>` as value and id type*** - Since 256-bit unsigned integers are not supported, +* **`Uint<128>` as value and id type** - Since 256-bit unsigned integers are not supported, the library uses the Compact type `Uint<128>`. -***Features and specifications NOT supported*** +**Features and specifications NOT supported** -* ***Events*** - Midnight does not currently support events, but this is planned on being supported in the future. -* ***Uint256 type*** - There’s ongoing research on ways to support uint256 in the future. -* ***Interface*** - Compact currently does not have a way to define a contract interface. +* **Events** - Midnight does not currently support events, but this is planned on being supported in the future. +* **Uint256 type** - There’s ongoing research on ways to support uint256 in the future. +* **Interface** - Compact currently does not have a way to define a contract interface. This library offers modules of contracts with free floating circuits; nevertheless, there’s no means of enforcing that all circuits are provided. -* ***Batch mint, burn, transfer*** - Without support for dynamic arrays, +* **Batch mint, burn, transfer** - Without support for dynamic arrays, batching transfers is difficult to do without a hacky solution. For instance, we could change the `to` and `from` parameters to be vectors. This would change the signature and would be both difficult to use and easy to misuse. -* ***Querying batched balances*** - This can be somewhat supported. +* **Querying batched balances** - This can be somewhat supported. The issue, without dynamic arrays, is that the module circuit must use `Vector` for accounts and ids; therefore, the implementing contract must explicitly define the number of balances to query in the circuit i.e. @@ -46,9 +46,9 @@ balanceOfBatch_10( Since this module does not offer mint or transfer batching, balance batching is also not included at this time. -* ***Introspection*** - Compact currently cannot support contract-to-contract queries for introspection. +* **Introspection** - Compact currently cannot support contract-to-contract queries for introspection. [ERC165] (or an equivalent thereof) is NOT included in the contract. -* ***Safe transfers*** - The lack of an introspection mechanism means safe transfers of any kind can not be supported. +* **Safe transfers** - The lack of an introspection mechanism means safe transfers of any kind can not be supported. ## Contract-to-contract calls From e825011f7e69608e67b0ba45f95b77b787bf05d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 11:55:30 -0400 Subject: [PATCH 17/43] update imports --- content/contracts-compact/multitoken.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/contracts-compact/multitoken.mdx b/content/contracts-compact/multitoken.mdx index ce32d72d..c55bef7b 100644 --- a/content/contracts-compact/multitoken.mdx +++ b/content/contracts-compact/multitoken.mdx @@ -71,7 +71,7 @@ It’s recommended to prefix the module with `MultiToken_` to avoid circuit sign pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; -import "./node_modules/@openzeppelin-compact/multi-token/src/MultiToken" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/MultiToken" prefix MultiToken_; constructor( @@ -108,7 +108,7 @@ The following example is a simple multi-token contract that creates both a fixed pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; -import "./node_modules/@openzeppelin-compact/multi-token/src/MultiToken" +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/MultiToken" prefix MultiToken_; constructor( From aaa7c0cac01973ffff852427d6fe18932ad86c28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 11:56:48 -0400 Subject: [PATCH 18/43] Update import --- content/contracts-compact/utils.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/contracts-compact/utils.mdx b/content/contracts-compact/utils.mdx index 3ad193df..66b41195 100644 --- a/content/contracts-compact/utils.mdx +++ b/content/contracts-compact/utils.mdx @@ -10,7 +10,7 @@ The Utils module provides miscellaneous circuits and common utilities for Compac pragma language_version >= {{compact_language_version}}; import CompactStandardLibrary; -import './node_modules/@openzeppelin-compact/utils/src/Utils' +import './compact-contracts/node_modules/@openzeppelin-compact/contracts/src/utils/Utils' prefix Utils_; export circuit performActionWhenEqual( From 4cd7b1a2af1444c727370beb46bb6162425b6c44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:00:55 -0400 Subject: [PATCH 19/43] Update page names --- src/navigation/midnight.json | 242 +++++++++++++++++------------------ 1 file changed, 121 insertions(+), 121 deletions(-) diff --git a/src/navigation/midnight.json b/src/navigation/midnight.json index 3c3954b7..0777268a 100644 --- a/src/navigation/midnight.json +++ b/src/navigation/midnight.json @@ -1,122 +1,122 @@ [ - { - "type": "separator", - "name": "Midnight Contracts" - }, - { - "type": "page", - "name": "Overview", - "url": "/contracts-compact" - }, - { - "type": "folder", - "name": "Learn", - "defaultOpen": true, - "children": [ - { - "type": "page", - "name": "Extensibility", - "url": "/contracts-compact/extensibility" - }, - { - "type": "page", - "name": "ZK Circuits 101", - "url": "/contracts-compact/zkCircuits101" - } - ] - }, - { - "type": "folder", - "name": "Modules", - "children": [ - { - "type": "folder", - "name": "Access", - "children": [ - { - "type": "page", - "name": "Ownable", - "url": "/contracts-compact/ownable" - }, - { - "type": "page", - "name": "Access Control", - "url": "/contracts-compact/access-control" - } - ] - }, - { - "type": "page", - "name": "Security", - "url": "/contracts-compact/security" - }, - { - "type": "folder", - "name": "Tokens", - "children": [ - { - "type": "page", - "name": "FungibleToken", - "url": "/contracts-compact/fungibleToken" - }, - { - "type": "page", - "name": "NonFungibleToken", - "url": "/contracts-compact/nonFungibleToken" - }, - { - "type": "page", - "name": "MultiToken", - "url": "/contracts-compact/multitoken" - } - ] - }, - { - "type": "page", - "name": "Utils", - "url": "/contracts-compact/utils" - } - ] - }, - { - "type": "folder", - "name": "API Reference", - "children": [ - { - "type": "page", - "name": "Access API", - "url": "/contracts-compact/api/access" - }, - { - "type": "page", - "name": "FungibleToken API", - "url": "/contracts-compact/api/fungibleToken" - }, - { - "type": "page", - "name": "MultiToken API", - "url": "/contracts-compact/api/multitoken" - }, - { - "type": "page", - "name": "NonFungibleToken API", - "url": "/contracts-compact/api/nonFungibleToken" - }, - { - "type": "page", - "name": "Ownable API", - "url": "/contracts-compact/api/ownable" - }, - { - "type": "page", - "name": "Security API", - "url": "/contracts-compact/api/security" - }, - { - "type": "page", - "name": "Utils API", - "url": "/contracts-compact/api/utils" - } - ] - } -] + { + "type": "separator", + "name": "Midnight Contracts" + }, + { + "type": "page", + "name": "Overview", + "url": "/contracts-compact" + }, + { + "type": "folder", + "name": "Learn", + "defaultOpen": true, + "children": [ + { + "type": "page", + "name": "Extensibility", + "url": "/contracts-compact/extensibility" + }, + { + "type": "page", + "name": "ZK Circuits 101", + "url": "/contracts-compact/zkCircuits101" + } + ] + }, + { + "type": "folder", + "name": "Modules", + "children": [ + { + "type": "folder", + "name": "Access", + "children": [ + { + "type": "page", + "name": "Ownable", + "url": "/contracts-compact/ownable" + }, + { + "type": "page", + "name": "AccessControl", + "url": "/contracts-compact/access-control" + } + ] + }, + { + "type": "page", + "name": "Security", + "url": "/contracts-compact/security" + }, + { + "type": "folder", + "name": "Tokens", + "children": [ + { + "type": "page", + "name": "FungibleToken", + "url": "/contracts-compact/fungibleToken" + }, + { + "type": "page", + "name": "NonFungibleToken", + "url": "/contracts-compact/nonFungibleToken" + }, + { + "type": "page", + "name": "MultiToken", + "url": "/contracts-compact/multitoken" + } + ] + }, + { + "type": "page", + "name": "Utils", + "url": "/contracts-compact/utils" + } + ] + }, + { + "type": "folder", + "name": "API Reference", + "children": [ + { + "type": "page", + "name": "AccessControl API", + "url": "/contracts-compact/api/access" + }, + { + "type": "page", + "name": "FungibleToken API", + "url": "/contracts-compact/api/fungibleToken" + }, + { + "type": "page", + "name": "MultiToken API", + "url": "/contracts-compact/api/multitoken" + }, + { + "type": "page", + "name": "NonFungibleToken API", + "url": "/contracts-compact/api/nonFungibleToken" + }, + { + "type": "page", + "name": "Ownable API", + "url": "/contracts-compact/api/ownable" + }, + { + "type": "page", + "name": "Security API", + "url": "/contracts-compact/api/security" + }, + { + "type": "page", + "name": "Utils API", + "url": "/contracts-compact/api/utils" + } + ] + } +] \ No newline at end of file From 14f1c969e01a637f5aebe6c4ea70d5faf30727ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:01:10 -0400 Subject: [PATCH 20/43] Update Page name --- content/contracts-compact/access-control.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/contracts-compact/access-control.mdx b/content/contracts-compact/access-control.mdx index 50269a72..dfe0155f 100644 --- a/content/contracts-compact/access-control.mdx +++ b/content/contracts-compact/access-control.mdx @@ -1,5 +1,5 @@ --- -title: Access Control +title: AccessControl --- {/* links */} From 9bb537f211e8a51582c39425bc0708844065e932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:23:31 -0400 Subject: [PATCH 21/43] Rename files and update paths --- .../{access-control.mdx => accessControl.mdx} | 0 .../contracts-compact/api/{access.mdx => accessControl.mdx} | 2 +- src/navigation/midnight.json | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) rename content/contracts-compact/{access-control.mdx => accessControl.mdx} (100%) rename content/contracts-compact/api/{access.mdx => accessControl.mdx} (99%) diff --git a/content/contracts-compact/access-control.mdx b/content/contracts-compact/accessControl.mdx similarity index 100% rename from content/contracts-compact/access-control.mdx rename to content/contracts-compact/accessControl.mdx diff --git a/content/contracts-compact/api/access.mdx b/content/contracts-compact/api/accessControl.mdx similarity index 99% rename from content/contracts-compact/api/access.mdx rename to content/contracts-compact/api/accessControl.mdx index 3862e786..6d57e704 100644 --- a/content/contracts-compact/api/access.mdx +++ b/content/contracts-compact/api/accessControl.mdx @@ -45,7 +45,7 @@ implement the `Initializable` module and set `DEFAULT_ADMIN_ROLE` in the `initia - For an overview of the module, read the [Access Control guide](../access). + For an overview of the module, read the [AccessControl guide](../access). ## Core diff --git a/src/navigation/midnight.json b/src/navigation/midnight.json index 0777268a..e83fc3f1 100644 --- a/src/navigation/midnight.json +++ b/src/navigation/midnight.json @@ -41,7 +41,7 @@ { "type": "page", "name": "AccessControl", - "url": "/contracts-compact/access-control" + "url": "/contracts-compact/accessControl" } ] }, @@ -85,7 +85,7 @@ { "type": "page", "name": "AccessControl API", - "url": "/contracts-compact/api/access" + "url": "/contracts-compact/api/accessControl" }, { "type": "page", From 0f9974fe82b33cb501de90f3d00d589e6d0c1293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:30:52 -0400 Subject: [PATCH 22/43] Fix toc formatting --- content/contracts-compact/api/accessControl.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/content/contracts-compact/api/accessControl.mdx b/content/contracts-compact/api/accessControl.mdx index 6d57e704..4e565cf5 100644 --- a/content/contracts-compact/api/accessControl.mdx +++ b/content/contracts-compact/api/accessControl.mdx @@ -60,6 +60,7 @@ import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/acc --- +### Ledger [toc] [#AccessControl-Ledger] ### Ledger [!toc] [#AccessControl-Ledger] #### _operatorRoles [toc] [#AccessControl-_operatorRoles] @@ -92,10 +93,12 @@ import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/acc The default `Bytes<32>` value mimicking a constant. +### Witnesses [toc] [#AccessControl-Witnesses] ### Witnesses [!toc] [#AccessControl-Witnesses] None. +### Circuits [toc] [#AccessControl-Circuits] ### Circuits [!toc] [#AccessControl-Circuits] #### hasRole [toc] [#AccessControl-hasRole] From 71e9f43d3634616b49e6fa2b8726a653dd2cc7f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:32:40 -0400 Subject: [PATCH 23/43] Update import path --- content/contracts-compact/api/fungibleToken.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/contracts-compact/api/fungibleToken.mdx b/content/contracts-compact/api/fungibleToken.mdx index f40b7eb2..af29525f 100644 --- a/content/contracts-compact/api/fungibleToken.mdx +++ b/content/contracts-compact/api/fungibleToken.mdx @@ -15,7 +15,7 @@ This module provides the full FungibleToken module API. [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/token/FungibleToken.compact) ```ts -import "./node-modules/@openzeppelin-compact/contracts/src/token/FungibleToken"; +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/"; ``` --- From c9f73ad180b0ef8f82395063b440468fc5a2ef06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:37:52 -0400 Subject: [PATCH 24/43] Fix toc formatting --- content/contracts-compact/api/fungibleToken.mdx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/contracts-compact/api/fungibleToken.mdx b/content/contracts-compact/api/fungibleToken.mdx index af29525f..da68f51b 100644 --- a/content/contracts-compact/api/fungibleToken.mdx +++ b/content/contracts-compact/api/fungibleToken.mdx @@ -20,6 +20,7 @@ import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/tok --- +### Ledger [toc] [#FungibleToken-Ledger] ### Ledger [!toc] [#FungibleToken-Ledger] #### _balances [toc] [#FungibleToken-_balances] @@ -39,7 +40,7 @@ import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/tok kind="ledger" id="FungibleToken-_allowances" > - Mapping from owner accounts to spender accounts and their allowances. + Mapping from owner accounts to spender accounts to their allowances. #### _totalSupply [toc] [#FungibleToken-_totalSupply] @@ -82,10 +83,12 @@ import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/tok The immutable token decimals. +### Witnesses [toc] [#FungibleToken-Witnesses] ### Witnesses [!toc] [#FungibleToken-Witnesses] None. +### Circuits [toc] [#FungibleToken-Circuits] ### Circuits [!toc] [#FungibleToken-Circuits] #### initialize [toc] [#FungibleToken-initialize] From b99decdddaf0ced269dfa85a3fc2f58c65ca285a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:38:52 -0400 Subject: [PATCH 25/43] update import --- content/contracts-compact/api/multitoken.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/contracts-compact/api/multitoken.mdx b/content/contracts-compact/api/multitoken.mdx index 37381a2d..0f0db036 100644 --- a/content/contracts-compact/api/multitoken.mdx +++ b/content/contracts-compact/api/multitoken.mdx @@ -15,7 +15,7 @@ This module provides the full MultiToken module API. [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/token/MultiToken.compact) ```ts -import "./node-modules/@openzeppelin-compact/contracts/src/token/MultiToken"; +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/"; ``` --- From 9f79196c3310cc1b1bbde1209798437ab4635738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:39:51 -0400 Subject: [PATCH 26/43] Fix toc formatting --- content/contracts-compact/api/multitoken.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/content/contracts-compact/api/multitoken.mdx b/content/contracts-compact/api/multitoken.mdx index 0f0db036..a9cd2c97 100644 --- a/content/contracts-compact/api/multitoken.mdx +++ b/content/contracts-compact/api/multitoken.mdx @@ -20,6 +20,7 @@ import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/tok --- +### Ledger [toc] [#MultiToken-Ledger] ### Ledger [!toc] [#MultiToken-Ledger] #### _balances [toc] [#MultiToken-_balances] @@ -52,10 +53,12 @@ import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/tok Base URI for computing token URIs. +### Witnesses [toc] [#MultiToken-Witnesses] ### Witnesses [!toc] [#MultiToken-Witnesses] None. +### Circuits [toc] [#MultiToken-Circuits] ### Circuits [!toc] [#MultiToken-Circuits] #### initialize [toc] [#MultiToken-initialize] From f99d585cf836cd1f97add7bdbd4829fdce9c7bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:40:44 -0400 Subject: [PATCH 27/43] Update import path --- content/contracts-compact/api/nonFungibleToken.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/contracts-compact/api/nonFungibleToken.mdx b/content/contracts-compact/api/nonFungibleToken.mdx index d9901005..6a22307c 100644 --- a/content/contracts-compact/api/nonFungibleToken.mdx +++ b/content/contracts-compact/api/nonFungibleToken.mdx @@ -15,7 +15,7 @@ This module provides the full NonFungibleToken module API. [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/token/NonFungibleToken.compact) ```ts -import "./node-modules/@openzeppelin-compact/contracts/src/token/NonFungibleToken"; +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/NonFungibleToken"; ``` --- From 2509c7e7c83cfdd34eac4f3aaf317de5e0238e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:41:29 -0400 Subject: [PATCH 28/43] Fix toc formatting --- content/contracts-compact/api/nonFungibleToken.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/content/contracts-compact/api/nonFungibleToken.mdx b/content/contracts-compact/api/nonFungibleToken.mdx index 6a22307c..f007f7ff 100644 --- a/content/contracts-compact/api/nonFungibleToken.mdx +++ b/content/contracts-compact/api/nonFungibleToken.mdx @@ -20,6 +20,7 @@ import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/tok --- +### Ledger [toc] [#NonFungibleToken-Ledger] ### Ledger [!toc] [#NonFungibleToken-Ledger] #### _name [toc] [#NonFungibleToken-_name] @@ -92,10 +93,12 @@ import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/tok Mapping from token IDs to their metadata URIs. +### Witnesses [toc] [#NonFungibleToken-Witnesses] ### Witnesses [!toc] [#NonFungibleToken-Witnesses] None. +### Circuits [toc] [#NonFungibleToken-Circuits] ### Circuits [!toc] [#NonFungibleToken-Circuits] #### initialize [toc] [#NonFungibleToken-initialize] From e6556edf5490a2fd5b9a8ce0f83b75cff3e5425a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:42:05 -0400 Subject: [PATCH 29/43] Update import path --- content/contracts-compact/api/ownable.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/contracts-compact/api/ownable.mdx b/content/contracts-compact/api/ownable.mdx index 35398152..5e39cfb9 100644 --- a/content/contracts-compact/api/ownable.mdx +++ b/content/contracts-compact/api/ownable.mdx @@ -15,7 +15,7 @@ For an overview of the module, read the [Ownable guide](../ownable). [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/access/Ownable.compact) ```ts -import "./node-modules/@openzeppelin-compact/contracts/src/access/Ownable"; +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/Ownable"; ``` --- @@ -199,7 +199,7 @@ None. [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/access/ZOwnablePK.compact) ```ts -import "./node-modules/@openzeppelin-compact/contracts/src/access/ZOwnablePK"; +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/ZOwnablePK"; ``` ### Ledger [!toc] [#ZOwnablePK-ledger] From e944eefc339850917bd8bf088094d423002735d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:44:38 -0400 Subject: [PATCH 30/43] Fix toc formatting --- content/contracts-compact/api/ownable.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/contracts-compact/api/ownable.mdx b/content/contracts-compact/api/ownable.mdx index 5e39cfb9..2afd8b2b 100644 --- a/content/contracts-compact/api/ownable.mdx +++ b/content/contracts-compact/api/ownable.mdx @@ -20,6 +20,7 @@ import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/acc --- +### Ledger [toc] [#Ownable-Ledger] ### Ledger [!toc] [#Ownable-Ledger] #### _owner [toc] [#Ownable-_owner] @@ -32,10 +33,12 @@ import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/acc Either a `ZswapCoinPublicKey` or `ContractAddress` representing the owner. +### Witnesses [toc] [#Ownable-Witnesses] ### Witnesses [!toc] [#Ownable-Witnesses] None. +### Circuits [toc] [#Ownable-Circuits] ### Circuits [!toc] [#Ownable-Circuits] #### initialize [toc] [#Ownable-initialize] @@ -202,6 +205,7 @@ None. import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/ZOwnablePK"; ``` +### Ledger [toc] [#ZOwnablePK-ledger] ### Ledger [!toc] [#ZOwnablePK-ledger] #### _ownerCommitment [toc] [#ZOwnablePK-_ownerCommitment] @@ -244,6 +248,7 @@ import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/acc It is immutable after initialization. +### Witnesses [toc] [#ZOwnablePK-witnesses] ### Witnesses [!toc] [#ZOwnablePK-witnesses] #### wit_secretNonce [toc] [#ZOwnablePK-wit_secretNonce] @@ -259,6 +264,7 @@ import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/acc Users are encouraged to rotate this value on ownership changes. +### Circuits [toc] [#ZOwnablePK-circuits] ### Circuits [!toc] [#ZOwnablePK-circuits] #### initialize [toc] [#ZOwnablePK-initialize] From cbbc0001b6e5924a83359c99f2aed5cd4f8e1ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:45:21 -0400 Subject: [PATCH 31/43] Fix import path --- content/contracts-compact/api/security.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/contracts-compact/api/security.mdx b/content/contracts-compact/api/security.mdx index 3452cd62..1410216c 100644 --- a/content/contracts-compact/api/security.mdx +++ b/content/contracts-compact/api/security.mdx @@ -15,7 +15,7 @@ This package provides the API for all Security modules. [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/security/Initializable.compact) ```ts -import "./node-modules/@openzeppelin-compact/contracts/src/security/Initializable"; +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/security/Initializable"; ``` --- @@ -90,7 +90,7 @@ None. [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/security/Pausable.compact) ```ts -import "./node-modules/@openzeppelin-compact/contracts/src/security/Pausable"; +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/security/Pausable"; ``` ### Ledger [!toc] [#Pausable-Ledger] From f578f259667e89bc9e7df7a3f304a74047b30be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:47:08 -0400 Subject: [PATCH 32/43] Fix toc formatting --- content/contracts-compact/api/security.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/contracts-compact/api/security.mdx b/content/contracts-compact/api/security.mdx index 1410216c..729a0afe 100644 --- a/content/contracts-compact/api/security.mdx +++ b/content/contracts-compact/api/security.mdx @@ -20,6 +20,7 @@ import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/sec --- +### Ledger [toc] [#Initializable-Ledger] ### Ledger [!toc] [#Initializable-Ledger] #### _isInitialized [toc] [#Initializable-_isInitialized] @@ -32,10 +33,12 @@ import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/sec Boolean indicating if initialized. +### Witnesses [toc] [#Initializable-Witnesses] ### Witnesses [!toc] [#Initializable-Witnesses] None. +### Circuits [toc] [#Initializable-Circuits] ### Circuits [!toc] [#Initializable-Circuits] #### initialize [toc] [#Initializable-initialize] @@ -93,6 +96,7 @@ None. import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/security/Pausable"; ``` +### Ledger [toc] [#Pausable-Ledger] ### Ledger [!toc] [#Pausable-Ledger] #### _isPaused [toc] [#Pausable-_isPaused] @@ -105,10 +109,12 @@ import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/sec Boolean indicating if paused. +### Witnesses [toc] [#Pausable-Witnesses] ### Witnesses [!toc] [#Pausable-Witnesses] None. +### Circuits [toc] [#Pausable-Circuits] ### Circuits [!toc] [#Pausable-Circuits] #### isPaused [toc] [#Pausable-isPaused] From 01ff0c6c1d6607accfcc8f409028aaab2b647a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:48:53 -0400 Subject: [PATCH 33/43] Fix toc formating --- content/contracts-compact/api/security.mdx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/content/contracts-compact/api/security.mdx b/content/contracts-compact/api/security.mdx index 729a0afe..0ad1a645 100644 --- a/content/contracts-compact/api/security.mdx +++ b/content/contracts-compact/api/security.mdx @@ -10,8 +10,6 @@ This package provides the API for all Security modules. ## Initializable -### Initializable - [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/security/Initializable.compact) ```ts @@ -88,8 +86,6 @@ None. ## Pausable -### Pausable - [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/security/Pausable.compact) ```ts From 6a80c799fbf3b43703ba577240a1cbb4f073647b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:51:52 -0400 Subject: [PATCH 34/43] Update section org --- content/contracts-compact/api/ownable.mdx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/content/contracts-compact/api/ownable.mdx b/content/contracts-compact/api/ownable.mdx index 2afd8b2b..5ef77336 100644 --- a/content/contracts-compact/api/ownable.mdx +++ b/content/contracts-compact/api/ownable.mdx @@ -8,9 +8,7 @@ This module provides the full Ownable module API. For an overview of the module, read the [Ownable guide](../ownable). -## Core - -### Ownable +## Ownable [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/access/Ownable.compact) @@ -197,7 +195,7 @@ None. * Contract is initialized. -### ZOwnablePK [#ZOwnablePK] +## ZOwnablePK [#ZOwnablePK] [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/access/ZOwnablePK.compact) From c127f83fe74c97e2b9160a83823c87d7dac26e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:52:12 -0400 Subject: [PATCH 35/43] Update section org --- content/contracts-compact/api/utils.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/contracts-compact/api/utils.mdx b/content/contracts-compact/api/utils.mdx index 7faca070..19cea234 100644 --- a/content/contracts-compact/api/utils.mdx +++ b/content/contracts-compact/api/utils.mdx @@ -10,26 +10,27 @@ This package provides the API for all Utils modules. ## Utils -### Utils - [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/utils/Utils.compact) ```ts -import "./node-modules/@openzeppelin-compact/contracts/src/security/Initializable"; +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/security/Initializable"; ``` There’s no easy way to get the constraints of circuits at this time so the constraints of the circuits listed below have been omitted. +### Ledger [toc] [#Utils-Ledger] ### Ledger [!toc] [#Utils-Ledger] None. +### Witnesses [toc] [#Utils-Witnesses] ### Witnesses [!toc] [#Utils-Witnesses] None. +### Circuits [toc] [#Utils-Circuits] ### Circuits [!toc] [#Utils-Circuits] #### isKeyOrAddressZero [toc] [#Utils-isKeyOrAddressZero] From e94f6edc2320c50249b0d348e9d4d7c5f27be20f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 13:02:46 -0400 Subject: [PATCH 36/43] format:fix --- src/navigation/midnight.json | 242 +++++++++++++++++------------------ 1 file changed, 121 insertions(+), 121 deletions(-) diff --git a/src/navigation/midnight.json b/src/navigation/midnight.json index e83fc3f1..d1411012 100644 --- a/src/navigation/midnight.json +++ b/src/navigation/midnight.json @@ -1,122 +1,122 @@ [ - { - "type": "separator", - "name": "Midnight Contracts" - }, - { - "type": "page", - "name": "Overview", - "url": "/contracts-compact" - }, - { - "type": "folder", - "name": "Learn", - "defaultOpen": true, - "children": [ - { - "type": "page", - "name": "Extensibility", - "url": "/contracts-compact/extensibility" - }, - { - "type": "page", - "name": "ZK Circuits 101", - "url": "/contracts-compact/zkCircuits101" - } - ] - }, - { - "type": "folder", - "name": "Modules", - "children": [ - { - "type": "folder", - "name": "Access", - "children": [ - { - "type": "page", - "name": "Ownable", - "url": "/contracts-compact/ownable" - }, - { - "type": "page", - "name": "AccessControl", - "url": "/contracts-compact/accessControl" - } - ] - }, - { - "type": "page", - "name": "Security", - "url": "/contracts-compact/security" - }, - { - "type": "folder", - "name": "Tokens", - "children": [ - { - "type": "page", - "name": "FungibleToken", - "url": "/contracts-compact/fungibleToken" - }, - { - "type": "page", - "name": "NonFungibleToken", - "url": "/contracts-compact/nonFungibleToken" - }, - { - "type": "page", - "name": "MultiToken", - "url": "/contracts-compact/multitoken" - } - ] - }, - { - "type": "page", - "name": "Utils", - "url": "/contracts-compact/utils" - } - ] - }, - { - "type": "folder", - "name": "API Reference", - "children": [ - { - "type": "page", - "name": "AccessControl API", - "url": "/contracts-compact/api/accessControl" - }, - { - "type": "page", - "name": "FungibleToken API", - "url": "/contracts-compact/api/fungibleToken" - }, - { - "type": "page", - "name": "MultiToken API", - "url": "/contracts-compact/api/multitoken" - }, - { - "type": "page", - "name": "NonFungibleToken API", - "url": "/contracts-compact/api/nonFungibleToken" - }, - { - "type": "page", - "name": "Ownable API", - "url": "/contracts-compact/api/ownable" - }, - { - "type": "page", - "name": "Security API", - "url": "/contracts-compact/api/security" - }, - { - "type": "page", - "name": "Utils API", - "url": "/contracts-compact/api/utils" - } - ] - } -] \ No newline at end of file + { + "type": "separator", + "name": "Midnight Contracts" + }, + { + "type": "page", + "name": "Overview", + "url": "/contracts-compact" + }, + { + "type": "folder", + "name": "Learn", + "defaultOpen": true, + "children": [ + { + "type": "page", + "name": "Extensibility", + "url": "/contracts-compact/extensibility" + }, + { + "type": "page", + "name": "ZK Circuits 101", + "url": "/contracts-compact/zkCircuits101" + } + ] + }, + { + "type": "folder", + "name": "Modules", + "children": [ + { + "type": "folder", + "name": "Access", + "children": [ + { + "type": "page", + "name": "Ownable", + "url": "/contracts-compact/ownable" + }, + { + "type": "page", + "name": "AccessControl", + "url": "/contracts-compact/accessControl" + } + ] + }, + { + "type": "page", + "name": "Security", + "url": "/contracts-compact/security" + }, + { + "type": "folder", + "name": "Tokens", + "children": [ + { + "type": "page", + "name": "FungibleToken", + "url": "/contracts-compact/fungibleToken" + }, + { + "type": "page", + "name": "NonFungibleToken", + "url": "/contracts-compact/nonFungibleToken" + }, + { + "type": "page", + "name": "MultiToken", + "url": "/contracts-compact/multitoken" + } + ] + }, + { + "type": "page", + "name": "Utils", + "url": "/contracts-compact/utils" + } + ] + }, + { + "type": "folder", + "name": "API Reference", + "children": [ + { + "type": "page", + "name": "AccessControl API", + "url": "/contracts-compact/api/accessControl" + }, + { + "type": "page", + "name": "FungibleToken API", + "url": "/contracts-compact/api/fungibleToken" + }, + { + "type": "page", + "name": "MultiToken API", + "url": "/contracts-compact/api/multitoken" + }, + { + "type": "page", + "name": "NonFungibleToken API", + "url": "/contracts-compact/api/nonFungibleToken" + }, + { + "type": "page", + "name": "Ownable API", + "url": "/contracts-compact/api/ownable" + }, + { + "type": "page", + "name": "Security API", + "url": "/contracts-compact/api/security" + }, + { + "type": "page", + "name": "Utils API", + "url": "/contracts-compact/api/utils" + } + ] + } +] From 7093431c0a1bed7fa358b471472572a1b07c5849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 13:56:37 -0400 Subject: [PATCH 37/43] Update links --- content/contracts-compact/accessControl.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/content/contracts-compact/accessControl.mdx b/content/contracts-compact/accessControl.mdx index dfe0155f..b7f4275f 100644 --- a/content/contracts-compact/accessControl.mdx +++ b/content/contracts-compact/accessControl.mdx @@ -9,14 +9,14 @@ title: AccessControl [FungibleToken]: ./fungibleToken.mdx [Ownable]: ./ownable.mdx [Initializable]: ./security#initializable -[AccessControl]: api/access - -[assertOnlyRole]: api/access#AccessControl-assertOnlyRole -[grantRole]: api/access#AccessControl-grantRole -[_grantRole]: api/access#AccessControl-_grantRole -[_unsafeGrantRole]: api/access#AccessControl-_unsafeGrantRole -[revokeRole]: api/access#AccessControl-revokeRole -[_setRoleAdmin]: api/access#AccessControl-_setRoleAdmin +[AccessControl]: api/accessControl + +[assertOnlyRole]: api/accessControl#AccessControl-assertOnlyRole +[grantRole]: api/accessControl#AccessControl-grantRole +[_grantRole]: api/accessControl#AccessControl-_grantRole +[_unsafeGrantRole]: api/accessControl#AccessControl-_unsafeGrantRole +[revokeRole]: api/accessControl#AccessControl-revokeRole +[_setRoleAdmin]: api/accessControl#AccessControl-_setRoleAdmin This module provides a role-based access control mechanism, where roles can be used to represent a set of permissions providing the flexibility to create different levels of account authorization. From 80e747527f0e03f6d9c8715f99c77725ae7f28c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 13:59:01 -0400 Subject: [PATCH 38/43] Update broken link --- content/contracts-compact/api/accessControl.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/contracts-compact/api/accessControl.mdx b/content/contracts-compact/api/accessControl.mdx index 4e565cf5..c6605d88 100644 --- a/content/contracts-compact/api/accessControl.mdx +++ b/content/contracts-compact/api/accessControl.mdx @@ -45,7 +45,7 @@ implement the `Initializable` module and set `DEFAULT_ADMIN_ROLE` in the `initia - For an overview of the module, read the [AccessControl guide](../access). + For an overview of the module, read the [AccessControl guide](../accessControl). ## Core From 11569889009ce6a4fbb62e392647cf2d7ac2feae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 17:25:09 -0400 Subject: [PATCH 39/43] Update content/contracts-compact/utils/constants.js Add newline Co-authored-by: Andrew Fleming --- content/contracts-compact/utils/constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/contracts-compact/utils/constants.js b/content/contracts-compact/utils/constants.js index ea787a91..a204daa8 100644 --- a/content/contracts-compact/utils/constants.js +++ b/content/contracts-compact/utils/constants.js @@ -1,2 +1,2 @@ export const COMPACT_COMPILER_VERSION = "0.24.0"; -export const COMPACT_LANGUAGE_VERSION = "0.16.0"; \ No newline at end of file +export const COMPACT_LANGUAGE_VERSION = "0.16.0"; From 1e1fb125a2a415b497fa3798a2eb5efb2c0c2f33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 17:30:25 -0400 Subject: [PATCH 40/43] Remove Core H2 --- content/contracts-compact/api/accessControl.mdx | 4 +--- content/contracts-compact/api/fungibleToken.mdx | 4 +--- content/contracts-compact/api/multitoken.mdx | 4 +--- content/contracts-compact/api/nonFungibleToken.mdx | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/content/contracts-compact/api/accessControl.mdx b/content/contracts-compact/api/accessControl.mdx index c6605d88..f78854ac 100644 --- a/content/contracts-compact/api/accessControl.mdx +++ b/content/contracts-compact/api/accessControl.mdx @@ -48,9 +48,7 @@ implement the `Initializable` module and set `DEFAULT_ADMIN_ROLE` in the `initia For an overview of the module, read the [AccessControl guide](../accessControl). -## Core - -### AccessControl +## AccessControl [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/access/AccessControl.compact) diff --git a/content/contracts-compact/api/fungibleToken.mdx b/content/contracts-compact/api/fungibleToken.mdx index da68f51b..340fabbf 100644 --- a/content/contracts-compact/api/fungibleToken.mdx +++ b/content/contracts-compact/api/fungibleToken.mdx @@ -8,9 +8,7 @@ This module provides the full FungibleToken module API. For an overview of the module, read the [FungibleToken guide](../fungibleToken). -## Core - -### FungibleToken +## FungibleToken [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/token/FungibleToken.compact) diff --git a/content/contracts-compact/api/multitoken.mdx b/content/contracts-compact/api/multitoken.mdx index a9cd2c97..a13878c8 100644 --- a/content/contracts-compact/api/multitoken.mdx +++ b/content/contracts-compact/api/multitoken.mdx @@ -8,9 +8,7 @@ This module provides the full MultiToken module API. For an overview of the module, read the [MultiToken guide](../multitoken). -## Core - -### MultiToken +## MultiToken [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/token/MultiToken.compact) diff --git a/content/contracts-compact/api/nonFungibleToken.mdx b/content/contracts-compact/api/nonFungibleToken.mdx index f007f7ff..d3b04ec0 100644 --- a/content/contracts-compact/api/nonFungibleToken.mdx +++ b/content/contracts-compact/api/nonFungibleToken.mdx @@ -8,9 +8,7 @@ This module provides the full NonFungibleToken module API. For an overview of the module, read the [NonFungibleToken guide](../nonFungibleToken). -## Core - -### NonFungibleToken +## NonFungibleToken [View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/token/NonFungibleToken.compact) From 44341c6ffbbe7d45c1b5c0360e5aeb6749eddbd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 18:11:29 -0400 Subject: [PATCH 41/43] Update module formating to use GitHubLinkHeader --- .../contracts-compact/api/accessControl.mdx | 8 +++++--- .../contracts-compact/api/fungibleToken.mdx | 10 ++++++---- content/contracts-compact/api/multitoken.mdx | 10 ++++++---- .../contracts-compact/api/nonFungibleToken.mdx | 8 +++++--- content/contracts-compact/api/ownable.mdx | 18 +++++++++++++----- content/contracts-compact/api/security.mdx | 18 +++++++++++++----- content/contracts-compact/api/utils.mdx | 10 +++++++--- 7 files changed, 55 insertions(+), 27 deletions(-) diff --git a/content/contracts-compact/api/accessControl.mdx b/content/contracts-compact/api/accessControl.mdx index f78854ac..37d55a26 100644 --- a/content/contracts-compact/api/accessControl.mdx +++ b/content/contracts-compact/api/accessControl.mdx @@ -48,9 +48,11 @@ implement the `Initializable` module and set `DEFAULT_ADMIN_ROLE` in the `initia For an overview of the module, read the [AccessControl guide](../accessControl). -## AccessControl - -[View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/access/AccessControl.compact) +## AccessControl [toc] [#AccessControl] + ```ts import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/AccessControl"; diff --git a/content/contracts-compact/api/fungibleToken.mdx b/content/contracts-compact/api/fungibleToken.mdx index 340fabbf..3778a0c0 100644 --- a/content/contracts-compact/api/fungibleToken.mdx +++ b/content/contracts-compact/api/fungibleToken.mdx @@ -8,12 +8,14 @@ This module provides the full FungibleToken module API. For an overview of the module, read the [FungibleToken guide](../fungibleToken). -## FungibleToken - -[View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/token/FungibleToken.compact) +## FungibleToken [toc] [#FungibleToken] + ```ts -import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/"; +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/FungibleToken"; ``` --- diff --git a/content/contracts-compact/api/multitoken.mdx b/content/contracts-compact/api/multitoken.mdx index a13878c8..3f0cc9e6 100644 --- a/content/contracts-compact/api/multitoken.mdx +++ b/content/contracts-compact/api/multitoken.mdx @@ -8,12 +8,14 @@ This module provides the full MultiToken module API. For an overview of the module, read the [MultiToken guide](../multitoken). -## MultiToken - -[View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/token/MultiToken.compact) +## MultiToken [toc] [#MultiToken] + ```ts -import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/"; +import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/MultiToken"; ``` --- diff --git a/content/contracts-compact/api/nonFungibleToken.mdx b/content/contracts-compact/api/nonFungibleToken.mdx index d3b04ec0..ad6e7724 100644 --- a/content/contracts-compact/api/nonFungibleToken.mdx +++ b/content/contracts-compact/api/nonFungibleToken.mdx @@ -8,9 +8,11 @@ This module provides the full NonFungibleToken module API. For an overview of the module, read the [NonFungibleToken guide](../nonFungibleToken). -## NonFungibleToken - -[View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/token/NonFungibleToken.compact) +## NonFungibleToken [toc] [#NonFungibleToken] + ```ts import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/NonFungibleToken"; diff --git a/content/contracts-compact/api/ownable.mdx b/content/contracts-compact/api/ownable.mdx index 5ef77336..ab892383 100644 --- a/content/contracts-compact/api/ownable.mdx +++ b/content/contracts-compact/api/ownable.mdx @@ -8,9 +8,11 @@ This module provides the full Ownable module API. For an overview of the module, read the [Ownable guide](../ownable). -## Ownable - -[View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/access/Ownable.compact) +## Ownable [toc] [#Ownable] + ```ts import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/Ownable"; @@ -195,14 +197,20 @@ None. * Contract is initialized. -## ZOwnablePK [#ZOwnablePK] +--- -[View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/access/ZOwnablePK.compact) +## ZOwnablePK [toc] [#ZOwnablePK] + ```ts import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/ZOwnablePK"; ``` +--- + ### Ledger [toc] [#ZOwnablePK-ledger] ### Ledger [!toc] [#ZOwnablePK-ledger] diff --git a/content/contracts-compact/api/security.mdx b/content/contracts-compact/api/security.mdx index 0ad1a645..e6f4dcd3 100644 --- a/content/contracts-compact/api/security.mdx +++ b/content/contracts-compact/api/security.mdx @@ -8,9 +8,11 @@ This package provides the API for all Security modules. For an overview of the module, read the [Security guide](../security). -## Initializable - -[View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/security/Initializable.compact) +## Initializable [toc] [#Initializable] + ```ts import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/security/Initializable"; @@ -84,14 +86,20 @@ None. * Contract must not be initialized. -## Pausable +--- -[View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/security/Pausable.compact) +## Pausable [toc] [#Pausable] + ```ts import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/security/Pausable"; ``` +--- + ### Ledger [toc] [#Pausable-Ledger] ### Ledger [!toc] [#Pausable-Ledger] diff --git a/content/contracts-compact/api/utils.mdx b/content/contracts-compact/api/utils.mdx index 19cea234..81a36c96 100644 --- a/content/contracts-compact/api/utils.mdx +++ b/content/contracts-compact/api/utils.mdx @@ -8,14 +8,18 @@ This package provides the API for all Utils modules. For an overview of the module, read the [Utils guide](/contracts-compact/utils). -## Utils - -[View on GitHub](https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/src/utils/Utils.compact) +## Utils [toc] [#Utils] + ```ts import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/security/Initializable"; ``` +--- + There’s no easy way to get the constraints of circuits at this time so the constraints of the circuits listed below have been omitted. From 9ef24612caa9650c30c14ace266cd978347908c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 18:12:49 -0400 Subject: [PATCH 42/43] Fix invalid DOM property error --- .../api-reference/api-github-link-header.tsx | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/components/ui/api-reference/api-github-link-header.tsx b/src/components/ui/api-reference/api-github-link-header.tsx index cde8684f..c0c5f30d 100644 --- a/src/components/ui/api-reference/api-github-link-header.tsx +++ b/src/components/ui/api-reference/api-github-link-header.tsx @@ -1,39 +1,39 @@ export function APIGithubLinkHeader({ - moduleName, - link, + moduleName, + link, }: { - moduleName: string; - link: string; + moduleName: string; + link: string; }) { - const id = moduleName; - return ( - - ); + const id = moduleName; + return ( + + ); } From 5de8da3c29febe880f74e6c3193bde6433fef14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9F=A3=20=E2=82=AC=E2=82=A5=E2=84=B5=E2=88=AA=E2=84=93?= =?UTF-8?q?=20=E2=9F=A2?= <34749913+emnul@users.noreply.github.com> Date: Mon, 29 Sep 2025 18:13:54 -0400 Subject: [PATCH 43/43] format:fix --- .../api-reference/api-github-link-header.tsx | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/components/ui/api-reference/api-github-link-header.tsx b/src/components/ui/api-reference/api-github-link-header.tsx index c0c5f30d..f0fb31a7 100644 --- a/src/components/ui/api-reference/api-github-link-header.tsx +++ b/src/components/ui/api-reference/api-github-link-header.tsx @@ -1,39 +1,39 @@ export function APIGithubLinkHeader({ - moduleName, - link, + moduleName, + link, }: { - moduleName: string; - link: string; + moduleName: string; + link: string; }) { - const id = moduleName; - return ( - - ); + const id = moduleName; + return ( + + ); }