From e99bb38b0ba35febb0cf3cf7008229344e81d6b8 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Thu, 23 Apr 2026 10:51:21 +0200 Subject: [PATCH 1/2] feat: Introduce llms.txt file and script for creating it --- package.json | 1 + public/llms.txt | 565 +++++++++++++++++++++++++++++++++++ scripts/generate-llms-txt.ts | 274 +++++++++++++++++ 3 files changed, 840 insertions(+) create mode 100644 public/llms.txt create mode 100644 scripts/generate-llms-txt.ts diff --git a/package.json b/package.json index 12514344..8b330037 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "lint:fix": "biome lint --write src/", "format": "biome format src/", "format:fix": "biome format --write src/", + "generate:llms-txt": "tsx scripts/generate-llms-txt.ts", "check": "biome check src/ && pnpm run lint:links", "check:fix": "biome check --write src/" }, diff --git a/public/llms.txt b/public/llms.txt new file mode 100644 index 00000000..1bca5ca7 --- /dev/null +++ b/public/llms.txt @@ -0,0 +1,565 @@ +# OpenZeppelin Docs + +> Security-first libraries, tools, and infrastructure for building on Ethereum and other blockchains. Covers smart contract libraries for Solidity, Cairo, Stylus, Sui, Midnight, Stellar, Zama FHEVM, and Polkadot; operational tools (Defender, Monitor, Relayer, UI Builder); and the Upgrades Plugins and Contract Wizard. + +Each ecosystem section lists the smart-contract libraries and language-specific guides for that chain. Cross-ecosystem tools — Defender, Monitor, Relayer, UI Builder, Role Manager — are grouped at the end under "Open Source Tools" to avoid duplication. Unversioned URLs (for example `/contracts/`) redirect to the latest supported version. + +## Ethereum & EVM + +- [Getting Started](https://docs.openzeppelin.com/contracts) + +### Solidity Contracts + +- [OpenZeppelin Contracts — Overview](https://docs.openzeppelin.com/contracts/5.x) +- [OpenZeppelin Contracts — Contracts Wizard](https://docs.openzeppelin.com/contracts/5.x/wizard) +- [OpenZeppelin Contracts — Extending Contracts](https://docs.openzeppelin.com/contracts/5.x/extending-contracts) +- [OpenZeppelin Contracts — Using with Upgrades](https://docs.openzeppelin.com/contracts/5.x/upgradeable) +- [OpenZeppelin Contracts — Backwards Compatibility](https://docs.openzeppelin.com/contracts/5.x/backwards-compatibility) +- [OpenZeppelin Contracts — Access Control](https://docs.openzeppelin.com/contracts/5.x/access-control) +- [OpenZeppelin Contracts — Account Abstraction — Overview](https://docs.openzeppelin.com/contracts/5.x/account-abstraction) +- [OpenZeppelin Contracts — Account Abstraction — Accounts — Overview](https://docs.openzeppelin.com/contracts/5.x/accounts) +- [OpenZeppelin Contracts — Account Abstraction — Accounts — EOA Delegation](https://docs.openzeppelin.com/contracts/5.x/eoa-delegation) +- [OpenZeppelin Contracts — Account Abstraction — Accounts — Multisig](https://docs.openzeppelin.com/contracts/5.x/multisig) +- [OpenZeppelin Contracts — Tokens — Overview](https://docs.openzeppelin.com/contracts/5.x/tokens) +- [OpenZeppelin Contracts — Tokens — ERC-20 — Overview](https://docs.openzeppelin.com/contracts/5.x/erc20) +- [OpenZeppelin Contracts — Tokens — ERC-20 — Creating Supply](https://docs.openzeppelin.com/contracts/5.x/erc20-supply) +- [OpenZeppelin Contracts — Tokens — ERC-721](https://docs.openzeppelin.com/contracts/5.x/erc721) +- [OpenZeppelin Contracts — Tokens — ERC-1155](https://docs.openzeppelin.com/contracts/5.x/erc1155) +- [OpenZeppelin Contracts — Tokens — ERC-4626](https://docs.openzeppelin.com/contracts/5.x/erc4626) +- [OpenZeppelin Contracts — Tokens — ERC-6909](https://docs.openzeppelin.com/contracts/5.x/erc6909) +- [OpenZeppelin Contracts — Governance](https://docs.openzeppelin.com/contracts/5.x/governance) +- [OpenZeppelin Contracts — Utilities](https://docs.openzeppelin.com/contracts/5.x/utilities) +- [OpenZeppelin Contracts — Subgraphs — Overview](https://docs.openzeppelin.com/contracts/5.x/subgraphs) +- [OpenZeppelin Contracts — Subgraphs — Automatic Generation](https://docs.openzeppelin.com/contracts/5.x/subgraphs/generate) +- [OpenZeppelin Contracts — Subgraphs — Query Examples](https://docs.openzeppelin.com/contracts/5.x/subgraphs/examples/query) +- [OpenZeppelin Contracts — Subgraphs — Subgraph Examples](https://docs.openzeppelin.com/contracts/5.x/subgraphs/examples/subgraph) +- [OpenZeppelin Contracts — FAQ](https://docs.openzeppelin.com/contracts/5.x/faq) +- [OpenZeppelin Contracts — Changelog](https://docs.openzeppelin.com/contracts/5.x/changelog) +- [OpenZeppelin Contracts — API Reference — Overview](https://docs.openzeppelin.com/contracts/5.x/api) +- [OpenZeppelin Contracts — API Reference — Access](https://docs.openzeppelin.com/contracts/5.x/api/access): Smart contract access utilities and implementations +- [OpenZeppelin Contracts — API Reference — Account](https://docs.openzeppelin.com/contracts/5.x/api/account): Smart contract account utilities and implementations +- [OpenZeppelin Contracts — API Reference — Crosschain](https://docs.openzeppelin.com/contracts/5.x/api/crosschain): Smart contract crosschain utilities and implementations +- [OpenZeppelin Contracts — API Reference — Finance](https://docs.openzeppelin.com/contracts/5.x/api/finance): Smart contract finance utilities and implementations +- [OpenZeppelin Contracts — API Reference — Governance](https://docs.openzeppelin.com/contracts/5.x/api/governance): Smart contract governance utilities and implementations +- [OpenZeppelin Contracts — API Reference — Interfaces](https://docs.openzeppelin.com/contracts/5.x/api/interfaces): Smart contract interfaces utilities and implementations +- [OpenZeppelin Contracts — API Reference — Meta Transactions](https://docs.openzeppelin.com/contracts/5.x/api/metatx): Smart contract metatx utilities and implementations +- [OpenZeppelin Contracts — API Reference — Proxy](https://docs.openzeppelin.com/contracts/5.x/api/proxy): Smart contract proxy utilities and implementations +- [OpenZeppelin Contracts — API Reference — Token — Common](https://docs.openzeppelin.com/contracts/5.x/api/token/common): Smart contract common utilities and implementations +- [OpenZeppelin Contracts — API Reference — Token — ERC20](https://docs.openzeppelin.com/contracts/5.x/api/token/ERC20): Smart contract ERC20 utilities and implementations +- [OpenZeppelin Contracts — API Reference — Token — ERC721](https://docs.openzeppelin.com/contracts/5.x/api/token/ERC721): Smart contract ERC721 utilities and implementations +- [OpenZeppelin Contracts — API Reference — Token — ERC1155](https://docs.openzeppelin.com/contracts/5.x/api/token/ERC1155): Smart contract ERC1155 utilities and implementations +- [OpenZeppelin Contracts — API Reference — Token — ERC6909](https://docs.openzeppelin.com/contracts/5.x/api/token/ERC6909): Smart contract ERC6909 utilities and implementations +- [OpenZeppelin Contracts — API Reference — Utils — Overview](https://docs.openzeppelin.com/contracts/5.x/api/utils): Smart contract utils utilities and implementations +- [OpenZeppelin Contracts — API Reference — Utils — Cryptography](https://docs.openzeppelin.com/contracts/5.x/api/utils/cryptography): Smart contract cryptography utilities and implementations +- [OpenZeppelin Contracts — Previous Versions — v4 — Overview](https://docs.openzeppelin.com/contracts/4.x) +- [OpenZeppelin Contracts — Previous Versions — v4 — Extending Contracts](https://docs.openzeppelin.com/contracts/4.x/extending-contracts) +- [OpenZeppelin Contracts — Previous Versions — v4 — Using with Upgrades](https://docs.openzeppelin.com/contracts/4.x/upgradeable) +- [OpenZeppelin Contracts — Previous Versions — v4 — Releases & Stability](https://docs.openzeppelin.com/contracts/4.x/releases-stability) +- [OpenZeppelin Contracts — Previous Versions — v4 — Access Control](https://docs.openzeppelin.com/contracts/4.x/access-control) +- [OpenZeppelin Contracts — Previous Versions — v4 — Tokens — Overview](https://docs.openzeppelin.com/contracts/4.x/tokens) +- [OpenZeppelin Contracts — Previous Versions — v4 — Tokens — ERC-20 — Overview](https://docs.openzeppelin.com/contracts/4.x/erc20) +- [OpenZeppelin Contracts — Previous Versions — v4 — Tokens — ERC-20 — Creating Supply](https://docs.openzeppelin.com/contracts/4.x/erc20-supply) +- [OpenZeppelin Contracts — Previous Versions — v4 — Tokens — ERC-721](https://docs.openzeppelin.com/contracts/4.x/erc721) +- [OpenZeppelin Contracts — Previous Versions — v4 — Tokens — ERC-777](https://docs.openzeppelin.com/contracts/4.x/erc777) +- [OpenZeppelin Contracts — Previous Versions — v4 — Tokens — ERC-1155](https://docs.openzeppelin.com/contracts/4.x/erc1155) +- [OpenZeppelin Contracts — Previous Versions — v4 — Tokens — ERC-4626](https://docs.openzeppelin.com/contracts/4.x/erc4626) +- [OpenZeppelin Contracts — Previous Versions — v4 — Crosschain](https://docs.openzeppelin.com/contracts/4.x/crosschain) +- [OpenZeppelin Contracts — Previous Versions — v4 — Governance](https://docs.openzeppelin.com/contracts/4.x/governance) +- [OpenZeppelin Contracts — Previous Versions — v4 — Utilities](https://docs.openzeppelin.com/contracts/4.x/utilities) +- [OpenZeppelin Contracts — Previous Versions — v4 — Drafts](https://docs.openzeppelin.com/contracts/4.x/drafts) +- [OpenZeppelin Contracts — Previous Versions — v4 — Crowdsales (Legacy)](https://docs.openzeppelin.com/contracts/4.x/crowdsales) +- [OpenZeppelin Contracts — Previous Versions — v4 — API Reference — Overview](https://docs.openzeppelin.com/contracts/4.x/api) +- [OpenZeppelin Contracts — Previous Versions — v4 — API Reference — Access](https://docs.openzeppelin.com/contracts/4.x/api/access): Smart contract access utilities and implementations +- [OpenZeppelin Contracts — Previous Versions — v4 — API Reference — Crosschain](https://docs.openzeppelin.com/contracts/4.x/api/crosschain): Smart contract crosschain utilities and implementations +- [OpenZeppelin Contracts — Previous Versions — v4 — API Reference — Finance](https://docs.openzeppelin.com/contracts/4.x/api/finance): Smart contract finance utilities and implementations +- [OpenZeppelin Contracts — Previous Versions — v4 — API Reference — Governance](https://docs.openzeppelin.com/contracts/4.x/api/governance): Smart contract governance utilities and implementations +- [OpenZeppelin Contracts — Previous Versions — v4 — API Reference — Interfaces](https://docs.openzeppelin.com/contracts/4.x/api/interfaces): Smart contract interfaces utilities and implementations +- [OpenZeppelin Contracts — Previous Versions — v4 — API Reference — Meta Transactions](https://docs.openzeppelin.com/contracts/4.x/api/metatx): Smart contract metatx utilities and implementations +- [OpenZeppelin Contracts — Previous Versions — v4 — API Reference — Proxy](https://docs.openzeppelin.com/contracts/4.x/api/proxy): Smart contract proxy utilities and implementations +- [OpenZeppelin Contracts — Previous Versions — v4 — API Reference — Security](https://docs.openzeppelin.com/contracts/4.x/api/security): Smart contract security utilities and implementations +- [OpenZeppelin Contracts — Previous Versions — v4 — API Reference — Token — Common](https://docs.openzeppelin.com/contracts/4.x/api/token/common): Smart contract common utilities and implementations +- [OpenZeppelin Contracts — Previous Versions — v4 — API Reference — Token — ERC20](https://docs.openzeppelin.com/contracts/4.x/api/token/ERC20): Smart contract ERC20 utilities and implementations +- [OpenZeppelin Contracts — Previous Versions — v4 — API Reference — Token — ERC721](https://docs.openzeppelin.com/contracts/4.x/api/token/ERC721): Smart contract ERC721 utilities and implementations +- [OpenZeppelin Contracts — Previous Versions — v4 — API Reference — Token — ERC777](https://docs.openzeppelin.com/contracts/4.x/api/token/ERC777): Smart contract ERC777 utilities and implementations +- [OpenZeppelin Contracts — Previous Versions — v4 — API Reference — Token — ERC1155](https://docs.openzeppelin.com/contracts/4.x/api/token/ERC1155): Smart contract ERC1155 utilities and implementations +- [OpenZeppelin Contracts — Previous Versions — v4 — API Reference — Utils](https://docs.openzeppelin.com/contracts/4.x/api/utils): Smart contract utils utilities and implementations +- [OpenZeppelin Contracts — Previous Versions — v3 — Overview](https://docs.openzeppelin.com/contracts/3.x) +- [OpenZeppelin Contracts — Previous Versions — v3 — Extending Contracts](https://docs.openzeppelin.com/contracts/3.x/extending-contracts) +- [OpenZeppelin Contracts — Previous Versions — v3 — Using with Upgrades](https://docs.openzeppelin.com/contracts/3.x/upgradeable) +- [OpenZeppelin Contracts — Previous Versions — v3 — Releases & Stability](https://docs.openzeppelin.com/contracts/3.x/releases-stability) +- [OpenZeppelin Contracts — Previous Versions — v3 — Access Control](https://docs.openzeppelin.com/contracts/3.x/access-control) +- [OpenZeppelin Contracts — Previous Versions — v3 — Tokens — Overview](https://docs.openzeppelin.com/contracts/3.x/tokens) +- [OpenZeppelin Contracts — Previous Versions — v3 — Tokens — ERC-20 — Overview](https://docs.openzeppelin.com/contracts/3.x/erc20) +- [OpenZeppelin Contracts — Previous Versions — v3 — Tokens — ERC-20 — Creating Supply](https://docs.openzeppelin.com/contracts/3.x/erc20-supply) +- [OpenZeppelin Contracts — Previous Versions — v3 — Tokens — ERC-721](https://docs.openzeppelin.com/contracts/3.x/erc721) +- [OpenZeppelin Contracts — Previous Versions — v3 — Tokens — ERC-777](https://docs.openzeppelin.com/contracts/3.x/erc777) +- [OpenZeppelin Contracts — Previous Versions — v3 — Tokens — ERC-1155](https://docs.openzeppelin.com/contracts/3.x/erc1155) +- [OpenZeppelin Contracts — Previous Versions — v3 — Gas Station Network — Overview](https://docs.openzeppelin.com/contracts/3.x/gsn) +- [OpenZeppelin Contracts — Previous Versions — v3 — Gas Station Network — Strategies](https://docs.openzeppelin.com/contracts/3.x/gsn-strategies) +- [OpenZeppelin Contracts — Previous Versions — v3 — Utilities](https://docs.openzeppelin.com/contracts/3.x/utilities) +- [Community Contracts — Overview](https://docs.openzeppelin.com/community-contracts) +- [Community Contracts — Account Abstraction — Modules](https://docs.openzeppelin.com/community-contracts/account-modules) +- [Community Contracts — Account Abstraction — Paymasters](https://docs.openzeppelin.com/community-contracts/paymasters) +- [Community Contracts — Crosschain](https://docs.openzeppelin.com/community-contracts/crosschain) +- [Community Contracts — Utilities](https://docs.openzeppelin.com/community-contracts/utilities) +- [Community Contracts — API Reference — Overview](https://docs.openzeppelin.com/community-contracts/api) +- [Community Contracts — API Reference — Access](https://docs.openzeppelin.com/community-contracts/api/access): Smart contract access utilities and implementations +- [Community Contracts — API Reference — Account](https://docs.openzeppelin.com/community-contracts/api/account): Smart contract account utilities and implementations +- [Community Contracts — API Reference — Crosschain](https://docs.openzeppelin.com/community-contracts/api/crosschain): Smart contract crosschain utilities and implementations +- [Community Contracts — API Reference — Interfaces](https://docs.openzeppelin.com/community-contracts/api/interfaces): Smart contract interfaces utilities and implementations +- [Community Contracts — API Reference — Proxy](https://docs.openzeppelin.com/community-contracts/api/proxy): Smart contract proxy utilities and implementations +- [Community Contracts — API Reference — Token](https://docs.openzeppelin.com/community-contracts/api/token): Smart contract token utilities and implementations +- [Community Contracts — API Reference — Utils](https://docs.openzeppelin.com/community-contracts/api/utils): Smart contract utils utilities and implementations +- [Community Contracts — API Reference — Cryptography](https://docs.openzeppelin.com/community-contracts/api/utils/cryptography): Smart contract cryptography utilities and implementations +- [Upgrades Plugins — Overview](https://docs.openzeppelin.com/upgrades-plugins) +- [Upgrades Plugins — Using with Hardhat — Overview](https://docs.openzeppelin.com/upgrades-plugins/hardhat-upgrades) +- [Upgrades Plugins — Using with Hardhat — Network Files](https://docs.openzeppelin.com/upgrades-plugins/network-files) +- [Upgrades Plugins — Using with Foundry](https://docs.openzeppelin.com/upgrades-plugins/foundry/foundry-upgrades) +- [Upgrades Plugins — Writing Upgradeable Contracts](https://docs.openzeppelin.com/upgrades-plugins/writing-upgradeable) +- [Upgrades Plugins — Proxy Upgrade Pattern](https://docs.openzeppelin.com/upgrades-plugins/proxies) +- [Upgrades Plugins — Frequently Asked Questions](https://docs.openzeppelin.com/upgrades-plugins/faq) + +### API Reference + +- [Upgrades Plugins — Hardhat Upgrades API](https://docs.openzeppelin.com/upgrades-plugins/api-hardhat-upgrades) +- [Upgrades Plugins — Foundry Upgrades API — Overview](https://docs.openzeppelin.com/upgrades-plugins/foundry/api) +- [Upgrades Plugins — Foundry Upgrades API — Upgrades](https://docs.openzeppelin.com/upgrades-plugins/foundry/api/Upgrades): Smart contract Upgrades utilities and implementations +- [Upgrades Plugins — Foundry Upgrades API — LegacyUpgrades](https://docs.openzeppelin.com/upgrades-plugins/foundry/api/LegacyUpgrades): Smart contract LegacyUpgrades utilities and implementations +- [Upgrades Plugins — Foundry Upgrades API — Defender](https://docs.openzeppelin.com/upgrades-plugins/foundry/api/Defender): Smart contract Defender utilities and implementations +- [Upgrades Plugins — Foundry Upgrades API — Options](https://docs.openzeppelin.com/upgrades-plugins/foundry/api/Options): Smart contract Options utilities and implementations +- [Upgrades Plugins — Upgrades Core & CLI](https://docs.openzeppelin.com/upgrades-plugins/api-core) +- [Contracts Wizard](https://docs.openzeppelin.com/wizard): A tool for building smart contracts +- [Learn — Overview](https://docs.openzeppelin.com/contracts/5.x/learn) +- [Learn — Setting up a Node project](https://docs.openzeppelin.com/contracts/5.x/learn/setting-up-a-node-project) +- [Learn — Developing smart contracts](https://docs.openzeppelin.com/contracts/5.x/learn/developing-smart-contracts) +- [Learn — Deploying and interacting](https://docs.openzeppelin.com/contracts/5.x/learn/deploying-and-interacting) +- [Learn — Writing automated tests](https://docs.openzeppelin.com/contracts/5.x/learn/writing-automated-tests) +- [Learn — Connecting to public test networks](https://docs.openzeppelin.com/contracts/5.x/learn/connecting-to-public-test-networks) +- [Learn — Upgrading smart contracts](https://docs.openzeppelin.com/contracts/5.x/learn/upgrading-smart-contracts) +- [Learn — Preparing for mainnet](https://docs.openzeppelin.com/contracts/5.x/learn/preparing-for-mainnet) +- [Learn — WebAuthn Smart Accounts](https://docs.openzeppelin.com/contracts/5.x/learn/webauthn-smart-accounts) + +## Stellar + +### Stellar Contracts + +- [Overview](https://docs.openzeppelin.com/stellar-contracts) +- [Get Started](https://docs.openzeppelin.com/stellar-contracts/get-started) +- [Accounts — Smart Account](https://docs.openzeppelin.com/stellar-contracts/accounts/smart-account) +- [Accounts — Context Rules](https://docs.openzeppelin.com/stellar-contracts/accounts/context-rules) +- [Accounts — Signers and Verifiers](https://docs.openzeppelin.com/stellar-contracts/accounts/signers-and-verifiers) +- [Accounts — Policies](https://docs.openzeppelin.com/stellar-contracts/accounts/policies) +- [Accounts — Authorization Flow](https://docs.openzeppelin.com/stellar-contracts/accounts/authorization-flow) +- [Tokens — Fungible](https://docs.openzeppelin.com/stellar-contracts/tokens/fungible/fungible) +- [Tokens — Non-Fungible](https://docs.openzeppelin.com/stellar-contracts/tokens/non-fungible/non-fungible) +- [Tokens — RWA](https://docs.openzeppelin.com/stellar-contracts/tokens/rwa/rwa) +- [Tokens — Vault](https://docs.openzeppelin.com/stellar-contracts/tokens/vault/vault) +- [Access — Access Control](https://docs.openzeppelin.com/stellar-contracts/access/access-control) +- [Access — Ownable](https://docs.openzeppelin.com/stellar-contracts/access/ownable) +- [Governance — Governor](https://docs.openzeppelin.com/stellar-contracts/governance/governor) +- [Governance — Votes](https://docs.openzeppelin.com/stellar-contracts/governance/votes) +- [Governance — Timelock Controller](https://docs.openzeppelin.com/stellar-contracts/governance/timelock-controller) +- [Utilities — Pausable](https://docs.openzeppelin.com/stellar-contracts/utils/pausable) +- [Utilities — Upgradeable](https://docs.openzeppelin.com/stellar-contracts/utils/upgradeable) +- [Utilities — Math — WAD](https://docs.openzeppelin.com/stellar-contracts/utils/math/wad): High-precision decimal arithmetic +- [Utilities — Cryptography](https://docs.openzeppelin.com/stellar-contracts/utils/crypto/crypto) +- [Utilities — Cryptography — Merkle Distributor](https://docs.openzeppelin.com/stellar-contracts/utils/crypto/merkle-distributor) +- [Fee Abstraction](https://docs.openzeppelin.com/stellar-contracts/fee-abstraction) + +## Starknet + +- [Getting Started](https://docs.openzeppelin.com/contracts-cairo) + +### Starknet Contracts + +- [Overview](https://docs.openzeppelin.com/contracts-cairo/3.x) +- [Wizard](https://docs.openzeppelin.com/contracts-cairo/3.x/wizard) +- [Learn — Components](https://docs.openzeppelin.com/contracts-cairo/3.x/components) +- [Learn — Presets](https://docs.openzeppelin.com/contracts-cairo/3.x/presets) +- [Learn — Interfaces and Dispatchers](https://docs.openzeppelin.com/contracts-cairo/3.x/guides/interfaces-and-dispatchers) +- [Learn — Counterfactual Deployments](https://docs.openzeppelin.com/contracts-cairo/3.x/guides/deployment) +- [Learn — SNIP12 and Typed Messages](https://docs.openzeppelin.com/contracts-cairo/3.x/guides/snip12) +- [Modules — Interfaces](https://docs.openzeppelin.com/contracts-cairo/3.x/interfaces) +- [Modules — Access Control](https://docs.openzeppelin.com/contracts-cairo/3.x/access) +- [Modules — Accounts](https://docs.openzeppelin.com/contracts-cairo/3.x/accounts) +- [Modules — Finance](https://docs.openzeppelin.com/contracts-cairo/3.x/finance) +- [Modules — Governance — Governor](https://docs.openzeppelin.com/contracts-cairo/3.x/governance/governor) +- [Modules — Governance — Multisig](https://docs.openzeppelin.com/contracts-cairo/3.x/governance/multisig) +- [Modules — Governance — Timelock](https://docs.openzeppelin.com/contracts-cairo/3.x/governance/timelock) +- [Modules — Governance — Votes](https://docs.openzeppelin.com/contracts-cairo/3.x/governance/votes) +- [Modules — Introspection](https://docs.openzeppelin.com/contracts-cairo/3.x/introspection) +- [Modules — Macros — Overview](https://docs.openzeppelin.com/contracts-cairo/3.x/macros) +- [Modules — Macros — Type Hash](https://docs.openzeppelin.com/contracts-cairo/3.x/macros/type_hash) +- [Modules — Macros — With Components](https://docs.openzeppelin.com/contracts-cairo/3.x/macros/with_components) +- [Modules — Security](https://docs.openzeppelin.com/contracts-cairo/3.x/security) +- [Modules — Tokens — ERC-20 — Overview](https://docs.openzeppelin.com/contracts-cairo/3.x/erc20) +- [Modules — Tokens — ERC-20 — Creating Supply](https://docs.openzeppelin.com/contracts-cairo/3.x/guides/erc20-supply) +- [Modules — Tokens — ERC-20 — ERC20 Permit](https://docs.openzeppelin.com/contracts-cairo/3.x/guides/erc20-permit) +- [Modules — Tokens — ERC-721](https://docs.openzeppelin.com/contracts-cairo/3.x/erc721) +- [Modules — Tokens — ERC-1155](https://docs.openzeppelin.com/contracts-cairo/3.x/erc1155) +- [Modules — Tokens — ERC-4626](https://docs.openzeppelin.com/contracts-cairo/3.x/erc4626) +- [Modules — Universal Deployer Contract — Overview](https://docs.openzeppelin.com/contracts-cairo/3.x/udc) +- [Modules — Universal Deployer Contract — UDC Appchain Deployment](https://docs.openzeppelin.com/contracts-cairo/3.x/guides/deploy-udc) +- [Modules — Upgrades](https://docs.openzeppelin.com/contracts-cairo/3.x/upgrades) +- [API Reference — Access Control](https://docs.openzeppelin.com/contracts-cairo/3.x/api/access) +- [API Reference — Account](https://docs.openzeppelin.com/contracts-cairo/3.x/api/account) +- [API Reference — ERC-20](https://docs.openzeppelin.com/contracts-cairo/3.x/api/erc20) +- [API Reference — ERC-721](https://docs.openzeppelin.com/contracts-cairo/3.x/api/erc721) +- [API Reference — ERC-1155](https://docs.openzeppelin.com/contracts-cairo/3.x/api/erc1155) +- [API Reference — ERC-4626](https://docs.openzeppelin.com/contracts-cairo/3.x/api/erc20#ERC4626Component) +- [API Reference — Token Common](https://docs.openzeppelin.com/contracts-cairo/3.x/api/token_common) +- [API Reference — Finance](https://docs.openzeppelin.com/contracts-cairo/3.x/api/finance) +- [API Reference — Governance](https://docs.openzeppelin.com/contracts-cairo/3.x/api/governance) +- [API Reference — Introspection](https://docs.openzeppelin.com/contracts-cairo/3.x/api/introspection) +- [API Reference — Merkle Tree](https://docs.openzeppelin.com/contracts-cairo/3.x/api/merkle-tree) +- [API Reference — Security](https://docs.openzeppelin.com/contracts-cairo/3.x/api/security) +- [API Reference — Testing](https://docs.openzeppelin.com/contracts-cairo/3.x/api/testing) +- [API Reference — UDC](https://docs.openzeppelin.com/contracts-cairo/3.x/api/udc) +- [API Reference — Upgrades](https://docs.openzeppelin.com/contracts-cairo/3.x/api/upgrades) +- [API Reference — Utilities](https://docs.openzeppelin.com/contracts-cairo/3.x/api/utilities) +- [Backwards Compatibility](https://docs.openzeppelin.com/contracts-cairo/3.x/backwards-compatibility) +- [Previous Versions — 2.x — Overview](https://docs.openzeppelin.com/contracts-cairo/2.x) +- [Previous Versions — 2.x — Wizard](https://docs.openzeppelin.com/contracts-cairo/2.x/wizard) +- [Previous Versions — 2.x — Learn — Components](https://docs.openzeppelin.com/contracts-cairo/2.x/components) +- [Previous Versions — 2.x — Learn — Presets](https://docs.openzeppelin.com/contracts-cairo/2.x/presets) +- [Previous Versions — 2.x — Learn — Interfaces and Dispatchers](https://docs.openzeppelin.com/contracts-cairo/2.x/guides/interfaces-and-dispatchers) +- [Previous Versions — 2.x — Learn — Counterfactual Deployments](https://docs.openzeppelin.com/contracts-cairo/2.x/guides/deployment) +- [Previous Versions — 2.x — Learn — SNIP12 and Typed Messages](https://docs.openzeppelin.com/contracts-cairo/2.x/guides/snip12) +- [Previous Versions — 2.x — Modules — Access Control](https://docs.openzeppelin.com/contracts-cairo/2.x/access) +- [Previous Versions — 2.x — Modules — Accounts](https://docs.openzeppelin.com/contracts-cairo/2.x/accounts) +- [Previous Versions — 2.x — Modules — Finance](https://docs.openzeppelin.com/contracts-cairo/2.x/finance) +- [Previous Versions — 2.x — Modules — Governance — Governor](https://docs.openzeppelin.com/contracts-cairo/2.x/governance/governor) +- [Previous Versions — 2.x — Modules — Governance — Multisig](https://docs.openzeppelin.com/contracts-cairo/2.x/governance/multisig) +- [Previous Versions — 2.x — Modules — Governance — Timelock](https://docs.openzeppelin.com/contracts-cairo/2.x/governance/timelock) +- [Previous Versions — 2.x — Modules — Governance — Votes](https://docs.openzeppelin.com/contracts-cairo/2.x/governance/votes) +- [Previous Versions — 2.x — Modules — Introspection](https://docs.openzeppelin.com/contracts-cairo/2.x/introspection) +- [Previous Versions — 2.x — Modules — Macros — Overview](https://docs.openzeppelin.com/contracts-cairo/2.x/macros) +- [Previous Versions — 2.x — Modules — Macros — Type Hash](https://docs.openzeppelin.com/contracts-cairo/2.x/macros/type_hash) +- [Previous Versions — 2.x — Modules — Macros — With Components](https://docs.openzeppelin.com/contracts-cairo/2.x/macros/with_components) +- [Previous Versions — 2.x — Modules — Security](https://docs.openzeppelin.com/contracts-cairo/2.x/security) +- [Previous Versions — 2.x — Modules — Tokens — ERC-20 — Overview](https://docs.openzeppelin.com/contracts-cairo/2.x/erc20) +- [Previous Versions — 2.x — Modules — Tokens — ERC-20 — Creating Supply](https://docs.openzeppelin.com/contracts-cairo/2.x/guides/erc20-supply) +- [Previous Versions — 2.x — Modules — Tokens — ERC-20 — ERC20 Permit](https://docs.openzeppelin.com/contracts-cairo/2.x/guides/erc20-permit) +- [Previous Versions — 2.x — Modules — Tokens — ERC-721](https://docs.openzeppelin.com/contracts-cairo/2.x/erc721) +- [Previous Versions — 2.x — Modules — Tokens — ERC-1155](https://docs.openzeppelin.com/contracts-cairo/2.x/erc1155) +- [Previous Versions — 2.x — Modules — Tokens — ERC-4626](https://docs.openzeppelin.com/contracts-cairo/2.x/erc4626) +- [Previous Versions — 2.x — Modules — Universal Deployer Contract — Overview](https://docs.openzeppelin.com/contracts-cairo/2.x/udc) +- [Previous Versions — 2.x — Modules — Universal Deployer Contract — UDC Appchain Deployment](https://docs.openzeppelin.com/contracts-cairo/2.x/guides/deploy-udc) +- [Previous Versions — 2.x — Modules — Upgrades](https://docs.openzeppelin.com/contracts-cairo/2.x/upgrades) +- [Previous Versions — 2.x — API Reference — Access Control](https://docs.openzeppelin.com/contracts-cairo/2.x/api/access) +- [Previous Versions — 2.x — API Reference — Account](https://docs.openzeppelin.com/contracts-cairo/2.x/api/account) +- [Previous Versions — 2.x — API Reference — ERC-20](https://docs.openzeppelin.com/contracts-cairo/2.x/api/erc20) +- [Previous Versions — 2.x — API Reference — ERC-721](https://docs.openzeppelin.com/contracts-cairo/2.x/api/erc721) +- [Previous Versions — 2.x — API Reference — ERC-1155](https://docs.openzeppelin.com/contracts-cairo/2.x/api/erc1155) +- [Previous Versions — 2.x — API Reference — ERC-4626](https://docs.openzeppelin.com/contracts-cairo/2.x/api/erc20#ERC4626Component) +- [Previous Versions — 2.x — API Reference — Token Common](https://docs.openzeppelin.com/contracts-cairo/2.x/api/token_common) +- [Previous Versions — 2.x — API Reference — Finance](https://docs.openzeppelin.com/contracts-cairo/2.x/api/finance) +- [Previous Versions — 2.x — API Reference — Governance](https://docs.openzeppelin.com/contracts-cairo/2.x/api/governance) +- [Previous Versions — 2.x — API Reference — Introspection](https://docs.openzeppelin.com/contracts-cairo/2.x/api/introspection) +- [Previous Versions — 2.x — API Reference — Merkle Tree](https://docs.openzeppelin.com/contracts-cairo/2.x/api/merkle-tree) +- [Previous Versions — 2.x — API Reference — Security](https://docs.openzeppelin.com/contracts-cairo/2.x/api/security) +- [Previous Versions — 2.x — API Reference — Testing](https://docs.openzeppelin.com/contracts-cairo/2.x/api/testing) +- [Previous Versions — 2.x — API Reference — UDC](https://docs.openzeppelin.com/contracts-cairo/2.x/api/udc) +- [Previous Versions — 2.x — API Reference — Upgrades](https://docs.openzeppelin.com/contracts-cairo/2.x/api/upgrades) +- [Previous Versions — 2.x — API Reference — Utilities](https://docs.openzeppelin.com/contracts-cairo/2.x/api/utilities) + +## Arbitrum Stylus + +### Arbitrum Stylus Contracts + +- [Overview](https://docs.openzeppelin.com/contracts-stylus) +- [Access Control](https://docs.openzeppelin.com/contracts-stylus/access-control) +- [Cryptography](https://docs.openzeppelin.com/contracts-stylus/crypto) +- [Finance](https://docs.openzeppelin.com/contracts-stylus/finance) +- [Tokens](https://docs.openzeppelin.com/contracts-stylus/tokens) +- [Tokens — ERC-20](https://docs.openzeppelin.com/contracts-stylus/erc20) +- [Tokens — ERC-721](https://docs.openzeppelin.com/contracts-stylus/erc721) +- [Tokens — ERC-1155](https://docs.openzeppelin.com/contracts-stylus/erc1155) +- [Tokens — ERC-4626](https://docs.openzeppelin.com/contracts-stylus/erc4626) +- [Proxy Patterns — Proxy](https://docs.openzeppelin.com/contracts-stylus/proxy) +- [Proxy Patterns — ERC-1967 Proxy](https://docs.openzeppelin.com/contracts-stylus/erc1967) +- [Proxy Patterns — Beacon Proxy](https://docs.openzeppelin.com/contracts-stylus/beacon-proxy) +- [Proxy Patterns — UUPS Proxy](https://docs.openzeppelin.com/contracts-stylus/uups-proxy) +- [Utilities](https://docs.openzeppelin.com/contracts-stylus/utilities) +- [Changelog](https://docs.openzeppelin.com/contracts-stylus/changelog) +- [Previous Versions — v0.2.0 — Overview](https://docs.openzeppelin.com/contracts-stylus/0.2.0) +- [Previous Versions — v0.2.0 — Access Control](https://docs.openzeppelin.com/contracts-stylus/0.2.0/access-control) +- [Previous Versions — v0.2.0 — Common](https://docs.openzeppelin.com/contracts-stylus/0.2.0/common) +- [Previous Versions — v0.2.0 — Cryptography](https://docs.openzeppelin.com/contracts-stylus/0.2.0/crypto) +- [Previous Versions — v0.2.0 — ERC Standards — ERC-20](https://docs.openzeppelin.com/contracts-stylus/0.2.0/erc20) +- [Previous Versions — v0.2.0 — ERC Standards — ERC-721](https://docs.openzeppelin.com/contracts-stylus/0.2.0/erc721) +- [Previous Versions — v0.2.0 — ERC Standards — ERC-1155](https://docs.openzeppelin.com/contracts-stylus/0.2.0/erc1155) +- [Previous Versions — v0.2.0 — ERC Standards — ERC-4626](https://docs.openzeppelin.com/contracts-stylus/0.2.0/erc4626) +- [Previous Versions — v0.2.0 — ERC Standards — ERC-2981](https://docs.openzeppelin.com/contracts-stylus/0.2.0/erc2981) +- [Previous Versions — v0.2.0 — Finance](https://docs.openzeppelin.com/contracts-stylus/0.2.0/finance) +- [Previous Versions — v0.2.0 — Tokens](https://docs.openzeppelin.com/contracts-stylus/0.2.0/tokens) +- [Previous Versions — v0.2.0 — Utilities](https://docs.openzeppelin.com/contracts-stylus/0.2.0/utilities) +- [Previous Versions — v0.2.0 — Vesting Wallet](https://docs.openzeppelin.com/contracts-stylus/0.2.0/vesting-wallet) +- [Previous Versions — v0.1.0 — Overview](https://docs.openzeppelin.com/contracts-stylus/0.1.0) +- [Previous Versions — v0.1.0 — Access Control](https://docs.openzeppelin.com/contracts-stylus/0.1.0/access-control) +- [Previous Versions — v0.1.0 — Cryptography](https://docs.openzeppelin.com/contracts-stylus/0.1.0/crypto) +- [Previous Versions — v0.1.0 — ERC Standards — ERC-20](https://docs.openzeppelin.com/contracts-stylus/0.1.0/erc20) +- [Previous Versions — v0.1.0 — ERC Standards — ERC-721](https://docs.openzeppelin.com/contracts-stylus/0.1.0/erc721) +- [Previous Versions — v0.1.0 — Tokens](https://docs.openzeppelin.com/contracts-stylus/0.1.0/tokens) + +## Sui + +- [Getting Started](https://docs.openzeppelin.com/contracts-sui) + +### Sui Contracts + +- [Overview](https://docs.openzeppelin.com/contracts-sui/1.x) +- [Learn — Overview](https://docs.openzeppelin.com/contracts-sui/1.x/learn) +- [Learn — Math Walkthrough](https://docs.openzeppelin.com/contracts-sui/1.x/learn/math-walkthrough) +- [Learn — Access Walkthrough](https://docs.openzeppelin.com/contracts-sui/1.x/learn/access-walkthrough) +- [Packages — Integer Math](https://docs.openzeppelin.com/contracts-sui/1.x/math) +- [Packages — Access](https://docs.openzeppelin.com/contracts-sui/1.x/access) +- [API Reference — Integer Math](https://docs.openzeppelin.com/contracts-sui/1.x/api/math) +- [API Reference — Access](https://docs.openzeppelin.com/contracts-sui/1.x/api/access) + +## Midnight + +### Midnight Contracts + +- [Overview](https://docs.openzeppelin.com/contracts-compact) +- [Learn — Extensibility](https://docs.openzeppelin.com/contracts-compact/extensibility) +- [Learn — ZK Circuits 101](https://docs.openzeppelin.com/contracts-compact/zkCircuits101) +- [Modules — Access — Ownable](https://docs.openzeppelin.com/contracts-compact/ownable) +- [Modules — Access — AccessControl](https://docs.openzeppelin.com/contracts-compact/accessControl) +- [Modules — Security](https://docs.openzeppelin.com/contracts-compact/security) +- [Modules — Tokens — FungibleToken](https://docs.openzeppelin.com/contracts-compact/fungibleToken) +- [Modules — Tokens — NonFungibleToken](https://docs.openzeppelin.com/contracts-compact/nonFungibleToken) +- [Modules — Tokens — MultiToken](https://docs.openzeppelin.com/contracts-compact/multitoken) +- [Modules — Utils](https://docs.openzeppelin.com/contracts-compact/utils) +- [API Reference — AccessControl API](https://docs.openzeppelin.com/contracts-compact/api/accessControl) +- [API Reference — FungibleToken API](https://docs.openzeppelin.com/contracts-compact/api/fungibleToken) +- [API Reference — MultiToken API](https://docs.openzeppelin.com/contracts-compact/api/multitoken) +- [API Reference — NonFungibleToken API](https://docs.openzeppelin.com/contracts-compact/api/nonFungibleToken) +- [API Reference — Ownable API](https://docs.openzeppelin.com/contracts-compact/api/ownable) +- [API Reference — Security API](https://docs.openzeppelin.com/contracts-compact/api/security) +- [API Reference — Utils API](https://docs.openzeppelin.com/contracts-compact/api/utils) + +## Zama FHEVM + +### Zama FHEVM Contracts + +- [Overview](https://docs.openzeppelin.com/confidential-contracts) +- [Token](https://docs.openzeppelin.com/confidential-contracts/token) +- [Changelog](https://docs.openzeppelin.com/confidential-contracts/changelog) +- [API Reference — Overview](https://docs.openzeppelin.com/confidential-contracts/api) +- [API Reference — Finance](https://docs.openzeppelin.com/confidential-contracts/api/finance): Smart contract finance utilities and implementations +- [API Reference — Governance](https://docs.openzeppelin.com/confidential-contracts/api/governance): Smart contract governance utilities and implementations +- [API Reference — Interfaces](https://docs.openzeppelin.com/confidential-contracts/api/interfaces): Smart contract interfaces utilities and implementations +- [API Reference — Token](https://docs.openzeppelin.com/confidential-contracts/api/token): Smart contract token utilities and implementations +- [API Reference — Utils](https://docs.openzeppelin.com/confidential-contracts/api/utils): Smart contract utils utilities and implementations + +## Polkadot + +### Polkadot Substrate Runtimes + +- [Overview](https://docs.openzeppelin.com/substrate-runtimes) +- [General Guides — Quick Start](https://docs.openzeppelin.com/substrate-runtimes/guides/quick_start) +- [General Guides — Weights & Fees](https://docs.openzeppelin.com/substrate-runtimes/guides/weights_fees) +- [General Guides — Async Backing](https://docs.openzeppelin.com/substrate-runtimes/guides/async_backing) +- [General Guides — Sending XCM between Parachains](https://docs.openzeppelin.com/substrate-runtimes/guides/hrmp_channels) +- [General Guides — OpenZeppelin Pallet Abstractions](https://docs.openzeppelin.com/substrate-runtimes/guides/pallet_abstractions) +- [General Guides — Pay DOT as a Fee](https://docs.openzeppelin.com/substrate-runtimes/guides/pay_dot_as_a_fee) +- [EVM Template Guides — Contract Migration](https://docs.openzeppelin.com/substrate-runtimes/guides/contract_migration) +- [EVM Template Guides — Predeployed Contracts](https://docs.openzeppelin.com/substrate-runtimes/guides/predeployed_contracts) +- [EVM Template Guides — Testing with Zombienet](https://docs.openzeppelin.com/substrate-runtimes/guides/testing_with_zombienet) +- [EVM Template Guides — RPC Differences](https://docs.openzeppelin.com/substrate-runtimes/guides/rpc_differences) +- [Runtimes — Generic Runtime](https://docs.openzeppelin.com/substrate-runtimes/runtimes/generic) +- [Runtimes — EVM Runtime](https://docs.openzeppelin.com/substrate-runtimes/runtimes/evm) +- [Runtime Descriptions — XCM Executor](https://docs.openzeppelin.com/substrate-runtimes/runtime/xcm_executor) +- [Pallet Specifications — cumulus_pallet_aura_ext](https://docs.openzeppelin.com/substrate-runtimes/pallets/aura_ext) +- [Pallet Specifications — cumulus_pallet_parachain_system](https://docs.openzeppelin.com/substrate-runtimes/pallets/parachain-system) +- [Pallet Specifications — cumulus_pallet_xcmp_queue](https://docs.openzeppelin.com/substrate-runtimes/pallets/xcmp-queue) +- [Pallet Specifications — pallet_assets](https://docs.openzeppelin.com/substrate-runtimes/pallets/assets) +- [Pallet Specifications — pallet_balances](https://docs.openzeppelin.com/substrate-runtimes/pallets/balances) +- [Pallet Specifications — pallet_collator_selection](https://docs.openzeppelin.com/substrate-runtimes/pallets/collator-selection) +- [Pallet Specifications — pallet_message_queue](https://docs.openzeppelin.com/substrate-runtimes/pallets/message-queue) +- [Pallet Specifications — pallet_multisig](https://docs.openzeppelin.com/substrate-runtimes/pallets/multisig) +- [Pallet Specifications — pallet_proxy](https://docs.openzeppelin.com/substrate-runtimes/pallets/proxy) +- [Pallet Specifications — pallet_transaction_payment](https://docs.openzeppelin.com/substrate-runtimes/pallets/transaction_payment) +- [Pallet Specifications — pallet_treasury](https://docs.openzeppelin.com/substrate-runtimes/pallets/treasury) +- [Pallet Specifications — pallet_xcm](https://docs.openzeppelin.com/substrate-runtimes/pallets/xcm) +- [Misc — Multisig Accounts](https://docs.openzeppelin.com/substrate-runtimes/misc/multisig-accounts) +- [Appendix — Glossary](https://docs.openzeppelin.com/substrate-runtimes/glossary) +- [Changelog](https://docs.openzeppelin.com/substrate-runtimes/changelog) +- [Previous Versions — v2.0.2 — Overview](https://docs.openzeppelin.com/substrate-runtimes/2.0.2) +- [Previous Versions — v2.0.2 — Quick Start](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/guides/quick_start) +- [Previous Versions — v2.0.2 — Pallets — Assets](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/pallets/assets) +- [Previous Versions — v2.0.2 — Pallets — Aura Ext](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/pallets/aura_ext) +- [Previous Versions — v2.0.2 — Pallets — Balances](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/pallets/balances) +- [Previous Versions — v2.0.2 — Pallets — Collator Selection](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/pallets/collator-selection) +- [Previous Versions — v2.0.2 — Pallets — Message Queue](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/pallets/message-queue) +- [Previous Versions — v2.0.2 — Pallets — Multisig](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/pallets/multisig) +- [Previous Versions — v2.0.2 — Pallets — Parachain System](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/pallets/parachain-system) +- [Previous Versions — v2.0.2 — Pallets — Proxy](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/pallets/proxy) +- [Previous Versions — v2.0.2 — Pallets — Transaction Payment](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/pallets/transaction_payment) +- [Previous Versions — v2.0.2 — Pallets — Treasury](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/pallets/treasury) +- [Previous Versions — v2.0.2 — Pallets — XCM](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/pallets/xcm) +- [Previous Versions — v2.0.2 — Pallets — XCMP Queue](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/pallets/xcmp-queue) +- [Previous Versions — v2.0.2 — Runtimes — EVM](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/runtimes/evm) +- [Previous Versions — v2.0.2 — Runtimes — Generic](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/runtimes/generic) +- [Previous Versions — v2.0.2 — Runtimes — XCM Executor](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/runtime/xcm_executor) +- [Previous Versions — v2.0.2 — Miscellaneous — Multisig Accounts](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/misc/multisig-accounts) +- [Previous Versions — v2.0.2 — Glossary](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/glossary) + +### Guides + +- [Previous Versions — v2.0.2 — Async Backing](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/guides/async_backing) +- [Previous Versions — v2.0.2 — Contract Migration](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/guides/contract_migration) +- [Previous Versions — v2.0.2 — HRMP Channels](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/guides/hrmp_channels) +- [Previous Versions — v2.0.2 — Predeployed Contracts](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/guides/predeployed_contracts) +- [Previous Versions — v2.0.2 — RPC Differences](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/guides/rpc_differences) +- [Previous Versions — v2.0.2 — Testing with Zombienet](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/guides/testing_with_zombienet) +- [Previous Versions — v2.0.2 — Weights & Fees](https://docs.openzeppelin.com/substrate-runtimes/2.0.2/guides/weights_fees) + +## Uniswap Hooks + +### Uniswap Hooks Contracts + +- [Overview](https://docs.openzeppelin.com/uniswap-hooks) +- [Base](https://docs.openzeppelin.com/uniswap-hooks/base) +- [Fee](https://docs.openzeppelin.com/uniswap-hooks/fee) +- [Utilities](https://docs.openzeppelin.com/uniswap-hooks/utilities) +- [Changelog](https://docs.openzeppelin.com/uniswap-hooks/changelog) +- [API Reference — Overview](https://docs.openzeppelin.com/uniswap-hooks/api) +- [API Reference — Base](https://docs.openzeppelin.com/uniswap-hooks/api/base): Smart contract base utilities and implementations +- [API Reference — Fee](https://docs.openzeppelin.com/uniswap-hooks/api/fee): Smart contract fee utilities and implementations +- [API Reference — General](https://docs.openzeppelin.com/uniswap-hooks/api/general): Smart contract general utilities and implementations +- [API Reference — Interfaces](https://docs.openzeppelin.com/uniswap-hooks/api/interfaces): Smart contract interfaces utilities and implementations +- [API Reference — Utils](https://docs.openzeppelin.com/uniswap-hooks/api/utils): Smart contract utils utilities and implementations + +## OpenZeppelin Impact + +### OpenZeppelin's Impact + +- [Overview](https://docs.openzeppelin.com/impact) +- [Contracts — The Impact of OpenZeppelin Contracts](https://docs.openzeppelin.com/impact/contracts-impact) +- [Contracts — Powering Top Financial Institutions](https://docs.openzeppelin.com/impact/contracts-for-financial-institutions) +- [Contracts — The Future of OpenZeppelin Contracts](https://docs.openzeppelin.com/impact/contracts-future) +- [Innovation & Research — Chain Abstraction](https://docs.openzeppelin.com/impact/chain-abstraction) +- [Innovation & Research — Privacy](https://docs.openzeppelin.com/impact/privacy) +- [Innovation & Research — Tokenization & Real World Assets](https://docs.openzeppelin.com/impact/tokenization-and-real-world-assets) + +## Open Source Tools + +- [Relayer — Overview](https://docs.openzeppelin.com/relayer/1.4.x) +- [Relayer — Quickstart](https://docs.openzeppelin.com/relayer/1.4.x/quickstart) +- [Relayer — Configuration — Overview](https://docs.openzeppelin.com/relayer/1.4.x/configuration) +- [Relayer — Configuration — Signers](https://docs.openzeppelin.com/relayer/1.4.x/configuration/signers) +- [Relayer — Configuration — Network Configuration](https://docs.openzeppelin.com/relayer/1.4.x/configuration/network) +- [Relayer — Configuration — Storage Configuration](https://docs.openzeppelin.com/relayer/1.4.x/configuration/storage) +- [Relayer — EVM Integration](https://docs.openzeppelin.com/relayer/1.4.x/evm) +- [Relayer — Solana Integration](https://docs.openzeppelin.com/relayer/1.4.x/solana) +- [Relayer — API Reference — Overview](https://docs.openzeppelin.com/relayer/1.4.x/api) +- [Relayer — API Reference — Relayers — List Relayers](https://docs.openzeppelin.com/relayer/1.4.x/api/listRelayers) +- [Relayer — API Reference — Relayers — Create Relayer](https://docs.openzeppelin.com/relayer/1.4.x/api/createRelayer) +- [Relayer — API Reference — Relayers — Get Relayer](https://docs.openzeppelin.com/relayer/1.4.x/api/getRelayer) +- [Relayer — API Reference — Relayers — Delete Relayer](https://docs.openzeppelin.com/relayer/1.4.x/api/deleteRelayer) +- [Relayer — API Reference — Relayers — Update Relayer](https://docs.openzeppelin.com/relayer/1.4.x/api/updateRelayer) +- [Relayer — API Reference — Relayers — Get Relayer Balance](https://docs.openzeppelin.com/relayer/1.4.x/api/getRelayerBalance) +- [Relayer — API Reference — Relayers — RPC](https://docs.openzeppelin.com/relayer/1.4.x/api/rpc) +- [Relayer — API Reference — Relayers — Sign](https://docs.openzeppelin.com/relayer/1.4.x/api/sign) +- [Relayer — API Reference — Relayers — Sign Transaction](https://docs.openzeppelin.com/relayer/1.4.x/api/signTransaction) +- [Relayer — API Reference — Relayers — Sign Typed Data](https://docs.openzeppelin.com/relayer/1.4.x/api/signTypedData) +- [Relayer — API Reference — Relayers — Get Relayer Status](https://docs.openzeppelin.com/relayer/1.4.x/api/getRelayerStatus) +- [Relayer — API Reference — Relayers — Send Transaction](https://docs.openzeppelin.com/relayer/1.4.x/api/sendTransaction) +- [Relayer — API Reference — Relayers — List Transactions](https://docs.openzeppelin.com/relayer/1.4.x/api/listTransactions) +- [Relayer — API Reference — Relayers — Get Transaction by Nonce](https://docs.openzeppelin.com/relayer/1.4.x/api/getTransactionByNonce) +- [Relayer — API Reference — Relayers — Delete Pending Transactions](https://docs.openzeppelin.com/relayer/1.4.x/api/deletePendingTransactions) +- [Relayer — API Reference — Relayers — Get Transaction by ID](https://docs.openzeppelin.com/relayer/1.4.x/api/getTransactionById) +- [Relayer — API Reference — Relayers — Replace Transaction](https://docs.openzeppelin.com/relayer/1.4.x/api/replaceTransaction) +- [Relayer — API Reference — Relayers — Cancel Transaction](https://docs.openzeppelin.com/relayer/1.4.x/api/cancelTransaction) +- [Relayer — API Reference — Relayers — Sponsored Transaction With Fee Payments](https://docs.openzeppelin.com/relayer/1.4.x/api/buildSponsoredTransaction) +- [Relayer — API Reference — Relayers — Sponsored Transaction Fee Estimate](https://docs.openzeppelin.com/relayer/1.4.x/api/quoteSponsoredTransaction) +- [Relayer — API Reference — Plugins — Call Plugin](https://docs.openzeppelin.com/relayer/1.4.x/api/callPlugin) +- [Relayer — API Reference — Plugins — Call PluginGet](https://docs.openzeppelin.com/relayer/1.4.x/api/callPluginGet) +- [Relayer — API Reference — Plugins — Get Plugin](https://docs.openzeppelin.com/relayer/1.4.x/api/getPlugin) +- [Relayer — API Reference — Plugins — UpdatePlugin](https://docs.openzeppelin.com/relayer/1.4.x/api/updatePlugin) +- [Relayer — API Reference — Plugins — ListPlugins](https://docs.openzeppelin.com/relayer/1.4.x/api/listPlugins) +- [Relayer — API Reference — Notifications — List Notifications](https://docs.openzeppelin.com/relayer/1.4.x/api/listNotifications) +- [Relayer — API Reference — Notifications — Create Notification](https://docs.openzeppelin.com/relayer/1.4.x/api/createNotification) +- [Relayer — API Reference — Notifications — Get Notification](https://docs.openzeppelin.com/relayer/1.4.x/api/getNotification) +- [Relayer — API Reference — Notifications — Delete Notification](https://docs.openzeppelin.com/relayer/1.4.x/api/deleteNotification) +- [Relayer — API Reference — Notifications — Update Notification](https://docs.openzeppelin.com/relayer/1.4.x/api/updateNotification) +- [Relayer — API Reference — Signers — List Signers](https://docs.openzeppelin.com/relayer/1.4.x/api/listSigners) +- [Relayer — API Reference — Signers — Create Signer](https://docs.openzeppelin.com/relayer/1.4.x/api/createSigner) +- [Relayer — API Reference — Signers — Get Signer](https://docs.openzeppelin.com/relayer/1.4.x/api/getSigner) +- [Relayer — API Reference — Signers — Delete Signer](https://docs.openzeppelin.com/relayer/1.4.x/api/deleteSigner) +- [Relayer — API Reference — Signers — Update Signer](https://docs.openzeppelin.com/relayer/1.4.x/api/updateSigner) +- [Relayer — API Reference — Metrics — Scrape Metrics](https://docs.openzeppelin.com/relayer/1.4.x/api/scrapeMetrics) +- [Relayer — API Reference — Metrics — List Metrics](https://docs.openzeppelin.com/relayer/1.4.x/api/listMetrics) +- [Relayer — API Reference — Metrics — Metric Detail](https://docs.openzeppelin.com/relayer/1.4.x/api/metricDetail) +- [Relayer — API Reference — Networks — List Networks](https://docs.openzeppelin.com/relayer/1.4.x/api/listNetworks) +- [Relayer — API Reference — Networks — Update Network](https://docs.openzeppelin.com/relayer/1.4.x/api/updateNetwork) +- [Relayer — API Reference — Health](https://docs.openzeppelin.com/relayer/1.4.x/api/health) +- [Relayer — API Reference — Health — Readiness](https://docs.openzeppelin.com/relayer/1.4.x/api/readiness) +- [Relayer — Project Structure](https://docs.openzeppelin.com/relayer/1.4.x/structure) +- [Relayer — Project Roadmap](https://docs.openzeppelin.com/relayer/1.4.x/roadmap) +- [Relayer — Plugins — Overview](https://docs.openzeppelin.com/relayer/1.4.x/plugins) +- [Relayer — Plugins — Channels](https://docs.openzeppelin.com/relayer/1.4.x/plugins/channels) +- [Relayer — Changelog](https://docs.openzeppelin.com/relayer/1.4.x/changelog) +- [Relayer — Stellar Integration](https://docs.openzeppelin.com/relayer/1.4.x/stellar) +- [Relayer — Guides — Overview](https://docs.openzeppelin.com/relayer/1.4.x/guides) +- [Relayer — Guides — Stellar Channels Guide](https://docs.openzeppelin.com/relayer/1.4.x/guides/stellar-channels-guide) +- [Relayer — Guides — Stellar Sponsored Transactions Guide](https://docs.openzeppelin.com/relayer/1.4.x/guides/stellar-sponsored-transactions-guide) +- [Relayer — Guides — Stellar X402 Facilitator Guide](https://docs.openzeppelin.com/relayer/1.4.x/guides/stellar-x402-facilitator-guide) +- [Relayer — Guides — Zama FHEVM Counter Guide](https://docs.openzeppelin.com/relayer/1.4.x/guides/zama-fhevm-counter-guide) +- [Relayer — Zama FHEVM Integration](https://docs.openzeppelin.com/relayer/1.4.x/zama-fhevm) +- [Monitor — Overview](https://docs.openzeppelin.com/monitor/1.3.x) +- [Monitor — Quickstart](https://docs.openzeppelin.com/monitor/1.3.x/quickstart) +- [Monitor — Architecture Guide](https://docs.openzeppelin.com/monitor/1.3.x/architecture) +- [Monitor — Project Structure](https://docs.openzeppelin.com/monitor/1.3.x/project-structure) +- [Monitor — RPC Client](https://docs.openzeppelin.com/monitor/1.3.x/rpc) +- [Monitor — Custom scripts](https://docs.openzeppelin.com/monitor/1.3.x/scripts) +- [Monitor — Error Handling](https://docs.openzeppelin.com/monitor/1.3.x/error) +- [Monitor — Testing](https://docs.openzeppelin.com/monitor/1.3.x/testing) +- [Monitor — Contribution guidelines](https://docs.openzeppelin.com/monitor/1.3.x/contribution) +- [Monitor — Changelog](https://docs.openzeppelin.com/monitor/1.3.x/changelog) +- [UI Builder — Quickstart](https://docs.openzeppelin.com/ui-builder) +- [UI Builder — Networks](https://docs.openzeppelin.com/ui-builder/networks) +- [UI Builder — Loading Contracts](https://docs.openzeppelin.com/ui-builder/loading-contracts) +- [UI Builder — Functions](https://docs.openzeppelin.com/ui-builder/functions) +- [UI Builder — Customization](https://docs.openzeppelin.com/ui-builder/customization) +- [UI Builder — Exporting and History](https://docs.openzeppelin.com/ui-builder/exporting-and-history) +- [UI Builder — Building Adapters](https://docs.openzeppelin.com/ui-builder/building-adapters) +- [UI Builder — Changelog](https://docs.openzeppelin.com/ui-builder/changelog) +- [Role Manager](https://docs.openzeppelin.com/role-manager) +- [Defender — Overview](https://docs.openzeppelin.com/defender) +- [Defender — Modules — Code Inspector](https://docs.openzeppelin.com/defender/module/code) +- [Defender — Modules — Audit](https://docs.openzeppelin.com/defender/module/audit) +- [Defender — Modules — Deploy](https://docs.openzeppelin.com/defender/module/deploy) +- [Defender — Modules — Relayers](https://docs.openzeppelin.com/defender/module/relayers) +- [Defender — Modules — Monitor](https://docs.openzeppelin.com/defender/module/monitor) +- [Defender — Modules — Actions](https://docs.openzeppelin.com/defender/module/actions) +- [Defender — Modules — Transaction Proposals](https://docs.openzeppelin.com/defender/module/transaction-proposals) +- [Defender — Modules — Address Book](https://docs.openzeppelin.com/defender/module/address-book) +- [Defender — Modules — Access Control](https://docs.openzeppelin.com/defender/module/access-control) +- [Defender — Settings — Overview](https://docs.openzeppelin.com/defender/settings) +- [Defender — Settings — Logs](https://docs.openzeppelin.com/defender/logs) +- [Defender — Settings — Notifications](https://docs.openzeppelin.com/defender/settings/notifications) +- [Defender — Tutorials — Deploy](https://docs.openzeppelin.com/defender/tutorial/deploy) +- [Defender — Tutorials — Relayer](https://docs.openzeppelin.com/defender/tutorial/relayer) +- [Defender — Tutorials — Monitor](https://docs.openzeppelin.com/defender/tutorial/monitor) +- [Defender — Tutorials — Actions](https://docs.openzeppelin.com/defender/tutorial/actions) +- [Defender — Tutorials — Access Control](https://docs.openzeppelin.com/defender/tutorial/access-control) +- [Defender — Tutorials — Workflows](https://docs.openzeppelin.com/defender/tutorial/workflows) +- [Defender — Guides — Deploy a smart contract on a forked network](https://docs.openzeppelin.com/defender/guide/forked-network) +- [Defender — Guides — Adding a complete private network](https://docs.openzeppelin.com/defender/guide/private-network) +- [Defender — Guides — Relaying gasless meta-transactions](https://docs.openzeppelin.com/defender/guide/meta-tx) +- [Defender — Guides — Automatic monitoring for factory clones](https://docs.openzeppelin.com/defender/guide/factory-monitor) +- [Defender — Guides — Managing roles of a TimelockController](https://docs.openzeppelin.com/defender/guide/timelock-roles) +- [Defender — Guides — Managing usage notifications](https://docs.openzeppelin.com/defender/guide/usage-notification) +- [Defender — Guides — Setup Fireblocks integrations within Defender](https://docs.openzeppelin.com/defender/guide/fireblock-defender-integration) +- [Defender — Guides — Upgrading actions dependencies](https://docs.openzeppelin.com/defender/guide/upgrade-actions-dependencies) +- [Defender — Defender as Code](https://docs.openzeppelin.com/defender/dac) +- [Defender — Remix Plugin](https://docs.openzeppelin.com/defender/remix-plugin) +- [Defender — Contracts Wizard Plugin](https://docs.openzeppelin.com/defender/wizard-plugin) +- [Defender — SDK and API](https://docs.openzeppelin.com/defender/sdk) +- [Defender — Migration to Open Source](https://docs.openzeppelin.com/defender/migration) +- [Defender — Integrations](https://docs.openzeppelin.com/defender/integrations) +- [Defender — FAQ](https://docs.openzeppelin.com/defender/faq) +- [Defender — Changelog](https://docs.openzeppelin.com/defender/changelog) diff --git a/scripts/generate-llms-txt.ts b/scripts/generate-llms-txt.ts new file mode 100644 index 00000000..4aea8b78 --- /dev/null +++ b/scripts/generate-llms-txt.ts @@ -0,0 +1,274 @@ +import { existsSync, readFileSync, writeFileSync } from "node:fs"; +import path from "node:path"; +import { + arbitrumStylusTree, + ethereumEvmTree, + impactTree, + midnightTree, + type NavigationFolder, + type NavigationNode, + type NavigationPage, + type NavigationTree, + polkadotTree, + starknetTree, + stellarTree, + suiTree, + uniswapTree, + zamaTree, +} from "@/navigation"; + +const SITE_ORIGIN = "https://docs.openzeppelin.com"; +const CONTENT_ROOT = path.resolve(process.cwd(), "content"); +const OUTPUT_PATH = path.resolve(process.cwd(), "public", "llms.txt"); + +const TREES: NavigationTree[] = [ + ethereumEvmTree, + stellarTree, + starknetTree, + arbitrumStylusTree, + suiTree, + midnightTree, + zamaTree, + polkadotTree, + uniswapTree, + impactTree, +]; + +const INTRO = `# OpenZeppelin Docs + +> Security-first libraries, tools, and infrastructure for building on Ethereum and other blockchains. Covers smart contract libraries for Solidity, Cairo, Stylus, Sui, Midnight, Stellar, Zama FHEVM, and Polkadot; operational tools (Defender, Monitor, Relayer, UI Builder); and the Upgrades Plugins and Contract Wizard. + +Each ecosystem section lists the smart-contract libraries and language-specific guides for that chain. Cross-ecosystem tools — Defender, Monitor, Relayer, UI Builder, Role Manager — are grouped at the end under "Open Source Tools" to avoid duplication. Unversioned URLs (for example \`/contracts/\`) redirect to the latest supported version. +`; + +const SHARED_TOOLS_SEPARATOR = "Open Source Tools"; + +const frontmatterCache = new Map< + string, + { title?: string; description?: string } | null +>(); + +function resolveMdxPath(url: string): string | null { + const withoutHash = url.split("#")[0].split("?")[0]; + const rel = withoutHash.replace(/^\//, "").replace(/\/$/, ""); + if (!rel) return null; + + const candidates = [ + path.join(CONTENT_ROOT, `${rel}.mdx`), + path.join(CONTENT_ROOT, rel, "index.mdx"), + ]; + for (const candidate of candidates) { + if (existsSync(candidate)) return candidate; + } + return null; +} + +function parseFrontmatter( + filePath: string, +): { title?: string; description?: string } | null { + const cached = frontmatterCache.get(filePath); + if (cached !== undefined) return cached; + + const raw = readFileSync(filePath, "utf8"); + const match = raw.match(/^---\r?\n([\s\S]*?)\r?\n---/); + if (!match) { + frontmatterCache.set(filePath, null); + return null; + } + + const result: { title?: string; description?: string } = {}; + for (const line of match[1].split(/\r?\n/)) { + const kv = line.match(/^(title|description)\s*:\s*(.*)$/); + if (!kv) continue; + let value = kv[2].trim(); + if ( + (value.startsWith('"') && value.endsWith('"')) || + (value.startsWith("'") && value.endsWith("'")) + ) { + value = value.slice(1, -1); + } + if (value) result[kv[1] as "title" | "description"] = value; + } + + frontmatterCache.set(filePath, result); + return result; +} + +function cleanDescription(raw: string): string { + return raw + .replace(/\s+/g, " ") + .replace(/\.\s*$/, "") + .trim(); +} + +function formatBullet(page: NavigationPage, breadcrumb: string[]): string { + if (page.external) return ""; + + const filePath = resolveMdxPath(page.url); + const frontmatter = filePath ? parseFrontmatter(filePath) : null; + + const label = [...breadcrumb, page.name] + .filter((s, i, arr) => !(i > 0 && arr[i - 1] === s)) + .join(" — "); + + const url = `${SITE_ORIGIN}${page.url}`; + const description = frontmatter?.description + ? `: ${cleanDescription(frontmatter.description)}` + : ""; + + return `- [${label}](${url})${description}`; +} + +interface WalkContext { + lines: string[]; + breadcrumb: string[]; + seen: Set; +} + +function walk(nodes: NavigationNode[], ctx: WalkContext): void { + for (const node of nodes) { + if (node.type === "separator") { + ctx.lines.push(""); + ctx.lines.push(`### ${node.name}`); + ctx.lines.push(""); + continue; + } + + if (node.type === "page") { + if (ctx.seen.has(node.url)) continue; + ctx.seen.add(node.url); + const bullet = formatBullet(node, ctx.breadcrumb); + if (bullet) ctx.lines.push(bullet); + continue; + } + + if (node.type === "folder") { + const folder = node as NavigationFolder; + const nextBreadcrumb = [...ctx.breadcrumb, folder.name]; + + if (folder.index && !ctx.seen.has(folder.index.url)) { + ctx.seen.add(folder.index.url); + const bullet = formatBullet(folder.index, nextBreadcrumb); + if (bullet) ctx.lines.push(bullet); + } + + walk(folder.children, { + ...ctx, + breadcrumb: nextBreadcrumb, + }); + } + } +} + +function splitSharedTools(nodes: NavigationNode[]): { + ecosystem: NavigationNode[]; + shared: NavigationNode[]; +} { + const separatorIndex = nodes.findIndex( + (n) => n.type === "separator" && n.name === SHARED_TOOLS_SEPARATOR, + ); + if (separatorIndex === -1) return { ecosystem: nodes, shared: [] }; + return { + ecosystem: nodes.slice(0, separatorIndex), + shared: nodes.slice(separatorIndex + 1), + }; +} + +function mergeByName(nodes: NavigationNode[]): NavigationNode[] { + const folders = new Map(); + const pages = new Map(); + const order: Array<{ kind: "folder" | "page"; key: string }> = []; + + for (const node of nodes) { + if (node.type === "separator") continue; + + if (node.type === "folder") { + const existing = folders.get(node.name); + if (existing) { + existing.children = mergeByName([ + ...existing.children, + ...node.children, + ]); + } else { + folders.set(node.name, { + type: "folder", + name: node.name, + defaultOpen: node.defaultOpen, + index: node.index, + children: mergeByName(node.children), + }); + order.push({ kind: "folder", key: node.name }); + } + continue; + } + + if (!pages.has(node.url)) { + pages.set(node.url, node); + order.push({ kind: "page", key: node.url }); + } + } + + return order.map((o) => + o.kind === "folder" + ? (folders.get(o.key) as NavigationNode) + : (pages.get(o.key) as NavigationNode), + ); +} + +function renderSection( + heading: string, + nodes: NavigationNode[], + sharedSeen: Set, +): string | null { + const lines: string[] = []; + walk(nodes, { + lines, + breadcrumb: [], + seen: sharedSeen, + }); + if (lines.every((l) => l.trim() === "" || l.startsWith("###"))) { + return null; + } + const body = `${heading}\n\n${lines.join("\n")}`; + return `${body.replace(/\n{3,}/g, "\n\n")}\n`; +} + +function main(): void { + const sharedSeen = new Set(); + const ecosystemSections: string[] = []; + const sharedToolNodes: NavigationNode[] = []; + + for (const tree of TREES) { + const { ecosystem, shared } = splitSharedTools(tree.children); + + const section = renderSection( + `## ${tree.name}`, + ecosystem, + new Set(), + ); + if (section) ecosystemSections.push(section); + + for (const node of shared) sharedToolNodes.push(node); + } + + const toolsSection = renderSection( + `## Open Source Tools`, + mergeByName(sharedToolNodes), + sharedSeen, + ); + + const parts = [INTRO, ...ecosystemSections]; + if (toolsSection) parts.push(toolsSection); + + writeFileSync(OUTPUT_PATH, parts.join("\n"), "utf8"); + + const pageCount = Array.from(frontmatterCache.keys()).length; + const missingCount = Array.from(frontmatterCache.values()).filter( + (v) => v === null, + ).length; + console.log(`Wrote ${OUTPUT_PATH}`); + console.log(` Pages with frontmatter: ${pageCount - missingCount}`); + console.log(` Pages without frontmatter: ${missingCount}`); +} + +main(); From 7f0b96200d2acc176ff90edab90ae9bf7e5394e0 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Wed, 29 Apr 2026 09:09:41 +0200 Subject: [PATCH 2/2] chore: Regenerate llms.txs and add new shared section --- README.md | 8 +++++ public/llms.txt | 17 ++++++++- scripts/generate-llms-txt.ts | 69 ++++++++++++++++++++++++------------ 3 files changed, 70 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 6dcab4a1..b9f3e761 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,14 @@ In the case you want to setup an automated GitHub workflow to create these API d 3. Follow existing directory structure for consistency 4. Update navigation if adding new product categories +### Updating `llms.txt` + +The `public/llms.txt` file is generated from the navigation tree and MDX frontmatter. Run the generator whenever you add, remove, rename, or reorder navigation items, or when you update page descriptions that should appear in `llms.txt`. + +```bash +pnpm run generate:llms-txt +``` + ### Versioning - Version-specific content in numbered subdirectories (e.g., `contracts/4.x/`) diff --git a/public/llms.txt b/public/llms.txt index 1bca5ca7..748e141d 100644 --- a/public/llms.txt +++ b/public/llms.txt @@ -2,7 +2,7 @@ > Security-first libraries, tools, and infrastructure for building on Ethereum and other blockchains. Covers smart contract libraries for Solidity, Cairo, Stylus, Sui, Midnight, Stellar, Zama FHEVM, and Polkadot; operational tools (Defender, Monitor, Relayer, UI Builder); and the Upgrades Plugins and Contract Wizard. -Each ecosystem section lists the smart-contract libraries and language-specific guides for that chain. Cross-ecosystem tools — Defender, Monitor, Relayer, UI Builder, Role Manager — are grouped at the end under "Open Source Tools" to avoid duplication. Unversioned URLs (for example `/contracts/`) redirect to the latest supported version. +Each ecosystem section lists the smart-contract libraries and language-specific guides for that chain. Cross-ecosystem developer libraries and tools are grouped at the end to avoid duplication. Unversioned URLs (for example `/contracts/`) redirect to the latest supported version. ## Ethereum & EVM @@ -444,6 +444,21 @@ Each ecosystem section lists the smart-contract libraries and language-specific - [Innovation & Research — Privacy](https://docs.openzeppelin.com/impact/privacy) - [Innovation & Research — Tokenization & Real World Assets](https://docs.openzeppelin.com/impact/tokenization-and-real-world-assets) +## Developer Libraries + +- [Ecosystem Adapters — Overview](https://docs.openzeppelin.com/ecosystem-adapters) +- [Ecosystem Adapters — Architecture](https://docs.openzeppelin.com/ecosystem-adapters/architecture) +- [Ecosystem Adapters — Getting Started](https://docs.openzeppelin.com/ecosystem-adapters/getting-started) +- [Ecosystem Adapters — Supported Ecosystems](https://docs.openzeppelin.com/ecosystem-adapters/supported-ecosystems) +- [Ecosystem Adapters — Building an Adapter](https://docs.openzeppelin.com/ecosystem-adapters/building-an-adapter) +- [UIKit — Overview](https://docs.openzeppelin.com/tools/uikit) +- [UIKit — Getting Started](https://docs.openzeppelin.com/tools/uikit/getting-started) +- [UIKit — Architecture](https://docs.openzeppelin.com/tools/uikit/architecture) +- [UIKit — Components](https://docs.openzeppelin.com/tools/uikit/components) +- [UIKit — React Integration](https://docs.openzeppelin.com/tools/uikit/react-integration) +- [UIKit — Theming & Styling](https://docs.openzeppelin.com/tools/uikit/theming) +- [UIKit — Storage](https://docs.openzeppelin.com/tools/uikit/storage) + ## Open Source Tools - [Relayer — Overview](https://docs.openzeppelin.com/relayer/1.4.x) diff --git a/scripts/generate-llms-txt.ts b/scripts/generate-llms-txt.ts index 4aea8b78..1cef3bad 100644 --- a/scripts/generate-llms-txt.ts +++ b/scripts/generate-llms-txt.ts @@ -38,10 +38,15 @@ const INTRO = `# OpenZeppelin Docs > Security-first libraries, tools, and infrastructure for building on Ethereum and other blockchains. Covers smart contract libraries for Solidity, Cairo, Stylus, Sui, Midnight, Stellar, Zama FHEVM, and Polkadot; operational tools (Defender, Monitor, Relayer, UI Builder); and the Upgrades Plugins and Contract Wizard. -Each ecosystem section lists the smart-contract libraries and language-specific guides for that chain. Cross-ecosystem tools — Defender, Monitor, Relayer, UI Builder, Role Manager — are grouped at the end under "Open Source Tools" to avoid duplication. Unversioned URLs (for example \`/contracts/\`) redirect to the latest supported version. +Each ecosystem section lists the smart-contract libraries and language-specific guides for that chain. Cross-ecosystem developer libraries and tools are grouped at the end to avoid duplication. Unversioned URLs (for example \`/contracts/\`) redirect to the latest supported version. `; -const SHARED_TOOLS_SEPARATOR = "Open Source Tools"; +const SHARED_SECTION_NAMES = [ + "Developer Libraries", + "Open Source Tools", +] as const; +type SharedSectionName = (typeof SHARED_SECTION_NAMES)[number]; +const SHARED_SECTION_NAME_SET = new Set(SHARED_SECTION_NAMES); const frontmatterCache = new Map< string, @@ -160,18 +165,32 @@ function walk(nodes: NavigationNode[], ctx: WalkContext): void { } } -function splitSharedTools(nodes: NavigationNode[]): { +function splitSharedSections(nodes: NavigationNode[]): { ecosystem: NavigationNode[]; - shared: NavigationNode[]; + shared: Map; } { - const separatorIndex = nodes.findIndex( - (n) => n.type === "separator" && n.name === SHARED_TOOLS_SEPARATOR, - ); - if (separatorIndex === -1) return { ecosystem: nodes, shared: [] }; - return { - ecosystem: nodes.slice(0, separatorIndex), - shared: nodes.slice(separatorIndex + 1), - }; + const ecosystem: NavigationNode[] = []; + const shared = new Map(); + let currentSharedSection: SharedSectionName | null = null; + + for (const node of nodes) { + if (node.type === "separator" && SHARED_SECTION_NAME_SET.has(node.name)) { + currentSharedSection = node.name as SharedSectionName; + if (!shared.has(currentSharedSection)) { + shared.set(currentSharedSection, []); + } + continue; + } + + if (currentSharedSection) { + shared.get(currentSharedSection)?.push(node); + continue; + } + + ecosystem.push(node); + } + + return { ecosystem, shared }; } function mergeByName(nodes: NavigationNode[]): NavigationNode[] { @@ -234,12 +253,11 @@ function renderSection( } function main(): void { - const sharedSeen = new Set(); const ecosystemSections: string[] = []; - const sharedToolNodes: NavigationNode[] = []; + const sharedSectionNodes = new Map(); for (const tree of TREES) { - const { ecosystem, shared } = splitSharedTools(tree.children); + const { ecosystem, shared } = splitSharedSections(tree.children); const section = renderSection( `## ${tree.name}`, @@ -248,17 +266,22 @@ function main(): void { ); if (section) ecosystemSections.push(section); - for (const node of shared) sharedToolNodes.push(node); + for (const [sectionName, nodes] of shared) { + const existing = sharedSectionNodes.get(sectionName) ?? []; + sharedSectionNodes.set(sectionName, [...existing, ...nodes]); + } } - const toolsSection = renderSection( - `## Open Source Tools`, - mergeByName(sharedToolNodes), - sharedSeen, - ); - const parts = [INTRO, ...ecosystemSections]; - if (toolsSection) parts.push(toolsSection); + for (const sectionName of SHARED_SECTION_NAMES) { + const nodes = sharedSectionNodes.get(sectionName) ?? []; + const section = renderSection( + `## ${sectionName}`, + mergeByName(nodes), + new Set(), + ); + if (section) parts.push(section); + } writeFileSync(OUTPUT_PATH, parts.join("\n"), "utf8");