From 15d5fcb508b51374d6702c037ad362c7ca65357f Mon Sep 17 00:00:00 2001 From: Eric Nordelo Date: Mon, 29 Jul 2024 14:05:31 +0200 Subject: [PATCH] doc: update imports --- Scarb.toml | 1 - docs/modules/ROOT/pages/access.adoc | 22 ++++---- docs/modules/ROOT/pages/accounts.adoc | 20 +++---- docs/modules/ROOT/pages/api/access.adoc | 6 +-- docs/modules/ROOT/pages/api/account.adoc | 10 ++-- docs/modules/ROOT/pages/api/erc1155.adoc | 14 ++--- docs/modules/ROOT/pages/api/erc20.adoc | 12 ++--- docs/modules/ROOT/pages/api/erc721.adoc | 14 ++--- docs/modules/ROOT/pages/api/governance.adoc | 2 +- .../modules/ROOT/pages/api/introspection.adoc | 4 +- docs/modules/ROOT/pages/api/security.adoc | 6 +-- docs/modules/ROOT/pages/api/udc.adoc | 4 +- docs/modules/ROOT/pages/api/upgrades.adoc | 4 +- docs/modules/ROOT/pages/api/utilities.adoc | 52 +++++++++---------- docs/modules/ROOT/pages/components.adoc | 22 ++++---- docs/modules/ROOT/pages/erc1155.adoc | 8 +-- docs/modules/ROOT/pages/erc20.adoc | 4 +- docs/modules/ROOT/pages/erc721.adoc | 8 +-- .../ROOT/pages/guides/erc20-supply.adoc | 4 +- docs/modules/ROOT/pages/guides/snip12.adoc | 20 +++---- .../ROOT/pages/guides/src5-migration.adoc | 6 +-- docs/modules/ROOT/pages/index.adoc | 2 +- docs/modules/ROOT/pages/interfaces.adoc | 4 +- docs/modules/ROOT/pages/introspection.adoc | 12 ++--- docs/modules/ROOT/pages/presets.adoc | 8 +-- docs/modules/ROOT/pages/security.adoc | 10 ++-- docs/modules/ROOT/pages/udc.adoc | 2 +- docs/modules/ROOT/pages/upgrades.adoc | 6 +-- 28 files changed, 143 insertions(+), 144 deletions(-) diff --git a/Scarb.toml b/Scarb.toml index 3a500bb60..9ac8ca001 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -37,7 +37,6 @@ keywords = [ [workspace.dependencies] starknet = "2.7.0-rc.3" -cairo_test = "2.7.0-rc.3" snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.26.0" } [dependencies] diff --git a/docs/modules/ROOT/pages/access.adoc b/docs/modules/ROOT/pages/access.adoc index 28f8fa8be..dbd987a1e 100644 --- a/docs/modules/ROOT/pages/access.adoc +++ b/docs/modules/ROOT/pages/access.adoc @@ -26,7 +26,7 @@ xref:/api/access.adoc#OwnableComponent-initializer[`initializer`] like this: ---- #[starknet::contract] mod MyContract { - use openzeppelin_access::ownable::OwnableComponent; + use openzeppelin::access::ownable::OwnableComponent; use starknet::ContractAddress; component!(path: OwnableComponent, storage: ownable, event: OwnableEvent); @@ -174,9 +174,9 @@ const MINTER_ROLE: felt252 = selector!("MINTER_ROLE"); #[starknet::contract] mod MyContract { - use openzeppelin_access::accesscontrol::AccessControlComponent; - use openzeppelin_introspection::src5::SRC5Component; - use openzeppelin_token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; + use openzeppelin::access::accesscontrol::AccessControlComponent; + use openzeppelin::introspection::src5::SRC5Component; + use openzeppelin::token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; use starknet::ContractAddress; use super::MINTER_ROLE; @@ -265,9 +265,9 @@ const BURNER_ROLE: felt252 = selector!("BURNER_ROLE"); #[starknet::contract] mod MyContract { - use openzeppelin_access::accesscontrol::AccessControlComponent; - use openzeppelin_introspection::src5::SRC5Component; - use openzeppelin_token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; + use openzeppelin::access::accesscontrol::AccessControlComponent; + use openzeppelin::introspection::src5::SRC5Component; + use openzeppelin::token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; use starknet::ContractAddress; use super::{MINTER_ROLE, BURNER_ROLE}; @@ -387,10 +387,10 @@ const BURNER_ROLE: felt252 = selector!("BURNER_ROLE"); #[starknet::contract] mod MyContract { - use openzeppelin_access::accesscontrol::AccessControlComponent; - use openzeppelin_access::accesscontrol::DEFAULT_ADMIN_ROLE; - use openzeppelin_introspection::src5::SRC5Component; - use openzeppelin_token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; + use openzeppelin::access::accesscontrol::AccessControlComponent; + use openzeppelin::access::accesscontrol::DEFAULT_ADMIN_ROLE; + use openzeppelin::introspection::src5::SRC5Component; + use openzeppelin::token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; use starknet::ContractAddress; use super::{MINTER_ROLE, BURNER_ROLE}; diff --git a/docs/modules/ROOT/pages/accounts.adoc b/docs/modules/ROOT/pages/accounts.adoc index 1cd0e8fed..bf064a01d 100644 --- a/docs/modules/ROOT/pages/accounts.adoc +++ b/docs/modules/ROOT/pages/accounts.adoc @@ -112,8 +112,8 @@ Constructing an account contract requires integrating both {account-component} a ---- #[starknet::contract(account)] mod MyAccount { - use openzeppelin_account::AccountComponent; - use openzeppelin_introspection::src5::SRC5Component; + use openzeppelin::account::AccountComponent; + use openzeppelin::introspection::src5::SRC5Component; component!(path: AccountComponent, storage: account, event: AccountEvent); component!(path: SRC5Component, storage: src5, event: SRC5Event); @@ -202,9 +202,9 @@ Here’s an example of a basic contract: ---- #[starknet::contract(account)] mod MyEthAccount { - use openzeppelin_account::EthAccountComponent; - use openzeppelin_account::interface::EthPublicKey; - use openzeppelin_introspection::src5::SRC5Component; + use openzeppelin::account::EthAccountComponent; + use openzeppelin::account::interface::EthPublicKey; + use openzeppelin::introspection::src5::SRC5Component; use starknet::ClassHash; component!(path: EthAccountComponent, storage: eth_account, event: EthAccountEvent); @@ -303,8 +303,8 @@ First, let's take the example account we created before and deploy it: ```[,cairo] #[starknet::contract(account)] mod MyAccount { - use openzeppelin_account::AccountComponent; - use openzeppelin_introspection::src5::SRC5Component; + use openzeppelin::account::AccountComponent; + use openzeppelin::introspection::src5::SRC5Component; component!(path: AccountComponent, storage: account, event: AccountEvent); component!(path: SRC5Component, storage: src5, event: SRC5Event); @@ -386,9 +386,9 @@ First, let's take the example account we created before and deploy it: ```[,cairo] #[starknet::contract(account)] mod MyEthAccount { - use openzeppelin_account::EthAccountComponent; - use openzeppelin_account::interface::EthPublicKey; - use openzeppelin_introspection::src5::SRC5Component; + use openzeppelin::account::EthAccountComponent; + use openzeppelin::account::interface::EthPublicKey; + use openzeppelin::introspection::src5::SRC5Component; component!(path: EthAccountComponent, storage: eth_account, event: EthAccountEvent); component!(path: SRC5Component, storage: src5, event: SRC5Event); diff --git a/docs/modules/ROOT/pages/api/access.adoc b/docs/modules/ROOT/pages/api/access.adoc index 529187cac..1b362e728 100644 --- a/docs/modules/ROOT/pages/api/access.adoc +++ b/docs/modules/ROOT/pages/api/access.adoc @@ -23,7 +23,7 @@ assigned each to multiple accounts. === `++OwnableComponent++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.15.0-rc.0/src/access/ownable/ownable.cairo[{github-icon},role=heading-link] ```cairo -use openzeppelin_access::ownable::OwnableComponent; +use openzeppelin::access::ownable::OwnableComponent; ``` `Ownable` provides a basic access control mechanism where an account @@ -276,7 +276,7 @@ Emitted when the ownership is transferred. :RoleAdminChanged: xref:#IAccessControl-RoleAdminChanged[RoleAdminChanged] ```cairo -use openzeppelin_access::accesscontrol::interface::IAccessControl; +use openzeppelin::access::accesscontrol::interface::IAccessControl; ``` External interface of AccessControl. @@ -407,7 +407,7 @@ Emitted when `account` is revoked `role`. :revoke_role: xref:#AccessControlComponent-revoke_role[revoke_role] ```cairo -use openzeppelin_access::accesscontrol::AccessControlComponent; +use openzeppelin::access::accesscontrol::AccessControlComponent; ``` Component that allows contracts to implement role-based access control mechanisms. diff --git a/docs/modules/ROOT/pages/api/account.adoc b/docs/modules/ROOT/pages/api/account.adoc index 34bbc3681..c5ece578d 100644 --- a/docs/modules/ROOT/pages/api/account.adoc +++ b/docs/modules/ROOT/pages/api/account.adoc @@ -15,7 +15,7 @@ include::../utils/_common.adoc[] === `++ISRC6++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.15.0-rc.0/src/account/interface.cairo[{github-icon},role=heading-link] ```cairo -use openzeppelin_account::interface::ISRC6; +use openzeppelin::account::interface::ISRC6; ``` Interface of the SRC6 Standard Account as defined in the {snip6}. @@ -72,7 +72,7 @@ Returns the short string `'VALID'` if valid, otherwise it reverts. :starknet-curve: https://docs.starknet.io/documentation/architecture_and_concepts/Cryptography/stark-curve/[Starknet curve] ```cairo -use openzeppelin_account::AccountComponent; +use openzeppelin::account::AccountComponent; ``` Account component implementing xref:ISRC6[`ISRC6`] for signatures over the {starknet-curve}. @@ -322,7 +322,7 @@ Emitted when a `public_key` is removed. :secp256k1-curve: https://en.bitcoin.it/wiki/Secp256k1[Secp256k1 curve] ```cairo -use openzeppelin_account::eth_account::EthAccountComponent; +use openzeppelin::account::eth_account::EthAccountComponent; ``` Account component implementing xref:ISRC6[`ISRC6`] for signatures over the {secp256k1-curve}. @@ -573,7 +573,7 @@ Emitted when a `public_key` is removed. === `++AccountUpgradeable++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.15.0-rc.0/src/presets/account.cairo[{github-icon},role=heading-link] ```cairo -use openzeppelin_presets::AccountUpgradeable; +use openzeppelin::presets::AccountUpgradeable; ``` Upgradeable account contract leveraging xref:#AccountComponent[AccountComponent]. @@ -634,7 +634,7 @@ Requirements: === `++EthAccountUpgradeable++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.15.0-rc.0/src/presets/eth_account.cairo[{github-icon},role=heading-link] ```cairo -use openzeppelin_presets::EthAccountUpgradeable; +use openzeppelin::presets::EthAccountUpgradeable; ``` Upgradeable account contract leveraging xref:#EthAccountComponent[EthAccountComponent]. diff --git a/docs/modules/ROOT/pages/api/erc1155.adoc b/docs/modules/ROOT/pages/api/erc1155.adoc index b3196697e..20846ec46 100644 --- a/docs/modules/ROOT/pages/api/erc1155.adoc +++ b/docs/modules/ROOT/pages/api/erc1155.adoc @@ -20,7 +20,7 @@ TIP: For an overview of ERC1155, read our xref:erc1155.adoc[ERC1155 guide]. [.hljs-theme-dark] ```cairo -use openzeppelin_token::erc1155::interface::IERC1155; +use openzeppelin::token::erc1155::interface::IERC1155; ``` Interface of the IERC1155 standard as defined in {eip1155}. @@ -130,7 +130,7 @@ Emitted when the token URI is updated to `value` for the `id` token. [.hljs-theme-dark] ```cairo -use openzeppelin_token::erc1155::interface::IERC1155MetadataURI; +use openzeppelin::token::erc1155::interface::IERC1155MetadataURI; ``` Interface for the optional metadata function in {eip1155-metadata}[EIP1155]. @@ -160,7 +160,7 @@ Returns the Uniform Resource Identifier (URI) for the `token_id` token. [.hljs-theme-dark] ```cairo -use openzeppelin_token::erc1155::ERC1155Component; +use openzeppelin::token::erc1155::ERC1155Component; ``` ERC1155 component implementing <> and <>. @@ -246,7 +246,7 @@ Hooks are functions which implementations can extend the functionality of the co using ERC1155Component is expected to provide an implementation of the ERC1155HooksTrait. For basic token contracts, an empty implementation with no logic must be provided. -TIP: You can use `openzeppelin_token::erc1155::ERC1155HooksEmptyImpl` which is already available as part of the library +TIP: You can use `openzeppelin::token::erc1155::ERC1155HooksEmptyImpl` which is already available as part of the library for this purpose. [.contract-item] @@ -547,7 +547,7 @@ See <>. [.hljs-theme-dark] ```cairo -use openzeppelin_token::erc1155::interface::IERC1155Receiver; +use openzeppelin::token::erc1155::interface::IERC1155Receiver; ``` Interface for contracts that support receiving token transfers from `ERC1155` contracts. @@ -587,7 +587,7 @@ via <> by [.hljs-theme-dark] ```cairo -use openzeppelin_token::erc1155::ERC1155ReceiverComponent; +use openzeppelin::token::erc1155::ERC1155ReceiverComponent; ``` ERC1155Receiver component implementing <>. @@ -663,7 +663,7 @@ Registers the `IERC1155Receiver` interface ID as supported through introspection === `++ERC1155Upgradeable++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.15.0-rc.0/src/presets/erc1155.cairo[{github-icon},role=heading-link] ```cairo -use openzeppelin_presets::ERC1155; +use openzeppelin::presets::ERC1155; ``` Upgradeable ERC1155 contract leveraging xref:#ERC1155Component[ERC1155Component]. diff --git a/docs/modules/ROOT/pages/api/erc20.adoc b/docs/modules/ROOT/pages/api/erc20.adoc index c4df315e5..05fe286fd 100644 --- a/docs/modules/ROOT/pages/api/erc20.adoc +++ b/docs/modules/ROOT/pages/api/erc20.adoc @@ -20,7 +20,7 @@ TIP: For an overview of ERC20, read our {erc20-guide}. [.hljs-theme-dark] ```cairo -use openzeppelin_token::erc20::interface::IERC20; +use openzeppelin::token::erc20::interface::IERC20; ``` Interface of the IERC20 standard as defined in {eip20}. @@ -118,7 +118,7 @@ Emitted when the allowance of a `spender` for an `owner` is set. [.hljs-theme-dark] ```cairo -use openzeppelin_token::erc20::interface::IERC20Metadata; +use openzeppelin::token::erc20::interface::IERC20Metadata; ``` Interface for the optional metadata functions in {eip20}. @@ -166,7 +166,7 @@ NOTE: This information is only used for _display_ purposes: it in no way affects [.hljs-theme-dark] ```cairo -use openzeppelin_token::erc20::ERC20Component; +use openzeppelin::token::erc20::ERC20Component; ``` ERC20 component extending <> and <>. @@ -242,7 +242,7 @@ Hooks are functions which implementations can extend the functionality of the co using ERC20Component is expected to provide an implementation of the ERC20HooksTrait. For basic token contracts, an empty implementation with no logic must be provided. -TIP: You can use `openzeppelin_token::erc20::ERC20HooksEmptyImpl` which is already available as part of the library +TIP: You can use `openzeppelin::token::erc20::ERC20HooksEmptyImpl` which is already available as part of the library for this purpose. [.contract-item] @@ -463,7 +463,7 @@ See <>. === `++ERC20VotesComponent++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.15.0-rc.0/src/token/erc20/extensions/erc20_votes.cairo[{github-icon},role=heading-link] ```cairo -use openzeppelin_token::extensions::ERC20VotesComponent; +use openzeppelin::token::extensions::ERC20VotesComponent; ``` :DelegateChanged: xref:ERC20VotesComponent-DelegateChanged[DelegateChanged] @@ -658,7 +658,7 @@ Emitted when `delegate` votes are updated from `previous_votes` to `new_votes`. === `++ERC20Upgradeable++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.15.0-rc.0/src/presets/erc20.cairo[{github-icon},role=heading-link] ```cairo -use openzeppelin_presets::ERC20Upgradeable; +use openzeppelin::presets::ERC20Upgradeable; ``` Upgradeable ERC20 contract leveraging xref:#ERC20Component[ERC20Component] with a fixed-supply mechanism for token distribution. diff --git a/docs/modules/ROOT/pages/api/erc721.adoc b/docs/modules/ROOT/pages/api/erc721.adoc index d671cae07..09ab75d29 100644 --- a/docs/modules/ROOT/pages/api/erc721.adoc +++ b/docs/modules/ROOT/pages/api/erc721.adoc @@ -20,7 +20,7 @@ TIP: For an overview of ERC721, read our xref:erc721.adoc[ERC721 guide]. [.hljs-theme-dark] ```cairo -use openzeppelin_token::erc721::interface::IERC721; +use openzeppelin::token::erc721::interface::IERC721; ``` Interface of the IERC721 standard as defined in {eip721}. @@ -139,7 +139,7 @@ Emitted when `token_id` token is transferred from `from` to `to`. [.hljs-theme-dark] ```cairo -use openzeppelin_token::erc721::interface::IERC721Metadata; +use openzeppelin::token::erc721::interface::IERC721Metadata; ``` Interface for the optional metadata functions in {eip721}. @@ -185,7 +185,7 @@ If the URI is not set for `token_id`, the return value will be an empty `ByteArr [.hljs-theme-dark] ```cairo -use openzeppelin_token::erc721::ERC721Component; +use openzeppelin::token::erc721::ERC721Component; ``` ERC721 component implementing <> and <>. @@ -292,7 +292,7 @@ Hooks are functions which implementations can extend the functionality of the co using ERC721Component is expected to provide an implementation of the ERC721HooksTrait. For basic token contracts, an empty implementation with no logic must be provided. -TIP: You can use `openzeppelin_token::erc721::ERC721HooksEmptyImpl` which is already available as part of the library +TIP: You can use `openzeppelin::token::erc721::ERC721HooksEmptyImpl` which is already available as part of the library for this purpose. [.contract-item] @@ -697,7 +697,7 @@ See <>. [.hljs-theme-dark] ```cairo -use openzeppelin_token::erc721::interface::IERC721Receiver; +use openzeppelin::token::erc721::interface::IERC721Receiver; ``` Interface for contracts that support receiving `safe_transfer_from` transfers. @@ -728,7 +728,7 @@ Whenever an IERC721 `token_id` token is transferred to this non-account contract [.hljs-theme-dark] ```cairo -use openzeppelin_token::erc721::ERC721ReceiverComponent; +use openzeppelin::token::erc721::ERC721ReceiverComponent; ``` ERC721Receiver component implementing <>. @@ -793,7 +793,7 @@ Registers the `IERC721Receiver` interface ID as supported through introspection. === `++ERC721Upgradeable++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.15.0-rc.0/src/presets/erc721.cairo[{github-icon},role=heading-link] ```cairo -use openzeppelin_presets::ERC721Upgradeable; +use openzeppelin::presets::ERC721Upgradeable; ``` Upgradeable ERC721 contract leveraging xref:#ERC721Component[ERC721Component]. diff --git a/docs/modules/ROOT/pages/api/governance.adoc b/docs/modules/ROOT/pages/api/governance.adoc index 59221fa3e..997815023 100644 --- a/docs/modules/ROOT/pages/api/governance.adoc +++ b/docs/modules/ROOT/pages/api/governance.adoc @@ -12,7 +12,7 @@ Reference of interfaces and utilities related to Governance. [.hljs-theme-dark] ```cairo -use openzeppelin_governance::utils::interfaces::IVotes; +use openzeppelin::governance::utils::interfaces::IVotes; ``` Common interface for Votes-enabled contracts. For an implementation example see diff --git a/docs/modules/ROOT/pages/api/introspection.adoc b/docs/modules/ROOT/pages/api/introspection.adoc index 6ff0e934a..77fb3b2b9 100644 --- a/docs/modules/ROOT/pages/api/introspection.adoc +++ b/docs/modules/ROOT/pages/api/introspection.adoc @@ -13,7 +13,7 @@ Reference of interfaces and utilities related to https://en.wikipedia.org/wiki/T === `++ISRC5++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.15.0-rc.0/src/introspection/interface.cairo#L7[{github-icon},role=heading-link] ```cairo -use openzeppelin_introspection::interface::ISRC5; +use openzeppelin::introspection::interface::ISRC5; ``` Interface of the SRC5 Introspection Standard as defined in {snip5}. @@ -47,7 +47,7 @@ on how to compute this ID. === `++SRC5Component++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.15.0-rc.0/src/introspection/src5.cairo[{github-icon},role=heading-link] ```cairo -use openzeppelin_introspection::src5::SRC5Component; +use openzeppelin::introspection::src5::SRC5Component; ``` SRC5 component extending xref:ISRC5[`ISRC5`]. diff --git a/docs/modules/ROOT/pages/api/security.adoc b/docs/modules/ROOT/pages/api/security.adoc index 8e4a4ba3d..3a6558408 100644 --- a/docs/modules/ROOT/pages/api/security.adoc +++ b/docs/modules/ROOT/pages/api/security.adoc @@ -11,7 +11,7 @@ Reference of components, interfaces and utilities found in the library's `securi === `++InitializableComponent++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.15.0-rc.0/src/security/initializable.cairo[{github-icon},role=heading-link] ```cairo -use openzeppelin_security::InitializableComponent; +use openzeppelin::security::InitializableComponent; ``` Component enabling one-time initialization for contracts. @@ -64,7 +64,7 @@ Requirements: :Unpaused: xref:PausableComponent-Unpaused[Unpaused] ```cairo -use openzeppelin_security::PausableComponent; +use openzeppelin::security::PausableComponent; ``` Component to implement an emergency stop mechanism. @@ -166,7 +166,7 @@ Emitted when the contract is unpaused by `account`. === `++ReentrancyGuardComponent++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.15.0-rc.0/src/security/reentrancyguard.cairo[{github-icon},role=heading-link] ```cairo -use openzeppelin_security::ReentrancyGuardComponent; +use openzeppelin::security::ReentrancyGuardComponent; ``` Component to help prevent reentrant calls. diff --git a/docs/modules/ROOT/pages/api/udc.adoc b/docs/modules/ROOT/pages/api/udc.adoc index 3f61021be..25c68731e 100644 --- a/docs/modules/ROOT/pages/api/udc.adoc +++ b/docs/modules/ROOT/pages/api/udc.adoc @@ -11,7 +11,7 @@ Reference of the Universal Deployer Contract (UDC) interface and preset. === `++IUniversalDeployer++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.10.0/src/utils/universal_deployer/interface.cairo#L7[{github-icon},role=heading-link] ```cairo -use openzeppelin_utils::interfaces::IUniversalDeployer; +use openzeppelin::utils::interfaces::IUniversalDeployer; ``` [.contract-index] @@ -54,7 +54,7 @@ Emitted when `deployer` deploys a contract through the Universal Deployer Contra === `++UniversalDeployer++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.10.0/src/presets/universal_deployer.cairo[{github-icon},role=heading-link] ```cairo -use openzeppelin_presets::UniversalDeployer; +use openzeppelin::presets::UniversalDeployer; ``` The standard Universal Deployer Contract. diff --git a/docs/modules/ROOT/pages/api/upgrades.adoc b/docs/modules/ROOT/pages/api/upgrades.adoc index 18a3378cc..08060dd87 100644 --- a/docs/modules/ROOT/pages/api/upgrades.adoc +++ b/docs/modules/ROOT/pages/api/upgrades.adoc @@ -14,7 +14,7 @@ Reference of interfaces and utilities related to upgradeability. :Upgraded: xref:UpgradeableComponent-Upgraded[Upgraded] ```cairo -use openzeppelin_upgrades::interface::IUpgradeable; +use openzeppelin::upgrades::interface::IUpgradeable; ``` Interface of an upgradeable contract. @@ -41,7 +41,7 @@ NOTE: This function is usually protected by an xref:access.adoc[Access Control] === `++UpgradeableComponent++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.15.0-rc.0/src/upgrades/upgradeable.cairo[{github-icon},role=heading-link] ```cairo -use openzeppelin_upgrades::upgradeable::UpgradeableComponent; +use openzeppelin::upgrades::upgradeable::UpgradeableComponent; ``` Upgradeable component. diff --git a/docs/modules/ROOT/pages/api/utilities.adoc b/docs/modules/ROOT/pages/api/utilities.adoc index 1566857fc..56c28ef5f 100644 --- a/docs/modules/ROOT/pages/api/utilities.adoc +++ b/docs/modules/ROOT/pages/api/utilities.adoc @@ -2,8 +2,8 @@ :deploy_syscall: link:https://docs.starknet.io/documentation/architecture_and_concepts/Smart_Contracts/system-calls-cairo1/#deploy[deploy_syscall] -The following documentation provides reasoning and examples for functions and constants found in `openzeppelin_utils` -and `use openzeppelin_utils::test_utils;`. +The following documentation provides reasoning and examples for functions and constants found in `openzeppelin::utils` +and `use openzeppelin::utils::test_utils;`. CAUTION: Expect this module to evolve (as it has already done). @@ -14,7 +14,7 @@ CAUTION: Expect this module to evolve (as it has already done). === `++utils++` ```cairo -use openzeppelin_utils; +use openzeppelin::utils; ``` Module containing core utilities of the library. @@ -77,8 +77,8 @@ casting and unwrapping the result multiple times. Usage example: ```cairo -use openzeppelin_utils::selectors; -use openzeppelin_utils::UnwrapAndCast; +use openzeppelin::utils::selectors; +use openzeppelin::utils::UnwrapAndCast; fn call_and_cast_to_bool(target: ContractAddress, args: Span) -> bool { try_selector_with_fallback( @@ -102,31 +102,31 @@ Note that it can be automatically casted to any type implementing the `Serde` tr [[utils-cryptography]] ==== `[.contract-item-name]#++cryptography++#` [.item-kind]#module# -See xref:#cryptography[`openzeppelin_utils::cryptography`]. +See xref:#cryptography[`openzeppelin::utils::cryptography`]. [.contract-item] [[utils-deployments]] ==== `[.contract-item-name]#++deployments++#` [.item-kind]#module# -See xref:#deployments[`openzeppelin_utils::deployments`]. +See xref:#deployments[`openzeppelin::utils::deployments`]. [.contract-item] [[utils-math]] ==== `[.contract-item-name]#++math++#` [.item-kind]#module# -See xref:#math[`openzeppelin_utils::math`]. +See xref:#math[`openzeppelin::utils::math`]. [.contract-item] [[utils-selectors]] ==== `[.contract-item-name]#++selectors++#` [.item-kind]#module# -See xref:#selectors[`openzeppelin_utils::selectors`]. +See xref:#selectors[`openzeppelin::utils::selectors`]. [.contract-item] [[utils-serde]] ==== `[.contract-item-name]#++serde++#` [.item-kind]#module# -See xref:#serde[`openzeppelin_utils::serde`]. +See xref:#serde[`openzeppelin::utils::serde`]. [.contract] [[cryptography]] @@ -135,7 +135,7 @@ See xref:#serde[`openzeppelin_utils::serde`]. :snip12: https://github.com/starknet-io/SNIPs/blob/main/SNIPS/snip-12.md[SNIP12] ```cairo -use openzeppelin_utils::cryptography; +use openzeppelin::utils::cryptography; ``` Module containing utilities related to cryptography. @@ -155,13 +155,13 @@ Module containing utilities related to cryptography. [[cryptography-nonces]] ==== `[.contract-item-name]#++nonces++#` [.item-kind]#module# -See xref:#NoncesComponent[`openzeppelin_utils::cryptography::nonces::NoncesComponent`]. +See xref:#NoncesComponent[`openzeppelin::utils::cryptography::nonces::NoncesComponent`]. [.contract-item] [[cryptography-snip12]] ==== `[.contract-item-name]#++snip12++#` [.item-kind]#module# -See xref:#snip12[`openzeppelin_utils::cryptography::snip12`]. +See xref:#snip12[`openzeppelin::utils::cryptography::snip12`]. [.contract] [[deployments]] @@ -170,7 +170,7 @@ See xref:#snip12[`openzeppelin_utils::cryptography::snip12`]. :udc-doc: xref:/udc.adoc[Universal Deployer Contract] ```cairo -use openzeppelin_utils::deployments; +use openzeppelin::utils::deployments; ``` Module containing utility functions for calculating contract addresses through {deploy_syscall} and the {udc-doc} (UDC). @@ -230,7 +230,7 @@ Origin-dependent deployments hash `salt` with `caller_address` (member of {deplo === `++math++` ```cairo -use openzeppelin_utils::math; +use openzeppelin::utils::math; ``` Module containing math utilities. @@ -258,7 +258,7 @@ NOTE: `T` is a generic value matching different numeric implementations. === `++selectors++` ```cairo -use openzeppelin_utils::selectors; +use openzeppelin::utils::selectors; ``` :selectors: https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.15.0-rc.0/src/utils/selectors.cairo[selectors.cairo] @@ -271,7 +271,7 @@ To see the full list of selectors, see {selectors}. === `++serde++` ```cairo -use openzeppelin_utils::serde; +use openzeppelin::utils::serde; ``` Module containing utilities related to serialization and deserialization of Cairo data structures. @@ -296,7 +296,7 @@ implementing the `Serde` trait to a `felt252` buffer. Usage example: ```cairo -use openzeppelin_utils::serde::SerializedAppend; +use openzeppelin::utils::serde::SerializedAppend; use starknet::ContractAddress; fn to_calldata(recipient: ContractAddress, amount: u256) -> Array { @@ -317,7 +317,7 @@ that implements the `Serde` trait. === `++NoncesComponent++` ```cairo -use openzeppelin_utils::cryptography::nonces::NoncesComponent; +use openzeppelin::utils::cryptography::nonces::NoncesComponent; ``` Simple component for managing nonces. @@ -372,7 +372,7 @@ Same as `use_nonce` but checking that `nonce` is the next valid one for `owner`. === `++snip12++` ```cairo -use openzeppelin_utils::snip12; +use openzeppelin::utils::snip12; ``` Supports on-chain generation of message hashes compliant with {snip12}. @@ -387,7 +387,7 @@ xref:/guides/snip12.adoc[SNIP12 and Typed Messages] guide. === `++utils++` ```cairo -use openzeppelin_utils::test_utils; +use openzeppelin::utils::test_utils; ``` Module containing utilities for testing the library. @@ -419,8 +419,8 @@ The `contract_address_salt` is always set to zero, and `deploy_from_zero` is set Usage example: ```cairo -use openzeppelin_presets::AccountUpgradeable; -use openzeppelin_utils::test_utils; +use openzeppelin::presets::AccountUpgradeable; +use openzeppelin::utils::test_utils; use starknet::ContractAddress; const PUBKEY: felt252 = 'PUBKEY'; @@ -459,9 +459,9 @@ Requirements: Usage example: ```cairo -use openzeppelin_utils::test_utils; -use openzeppelin_token::erc20::ERC20Component; -use openzeppelin_token::erc20::ERC20Component::Transfer; +use openzeppelin::utils::test_utils; +use openzeppelin::token::erc20::ERC20Component; +use openzeppelin::token::erc20::ERC20Component::Transfer; use starknet::ContractAddress; fn assert_emitted_event( diff --git a/docs/modules/ROOT/pages/components.adoc b/docs/modules/ROOT/pages/components.adoc index eb3051414..8d527b332 100644 --- a/docs/modules/ROOT/pages/components.adoc +++ b/docs/modules/ROOT/pages/components.adoc @@ -25,7 +25,7 @@ The contract should first import the component and declare it with the `componen #[starknet::contract] mod MyContract { // Import the component - use openzeppelin_security::InitializableComponent; + use openzeppelin::security::InitializableComponent; // Declare the component component!(path: InitializableComponent, storage: initializable, event: InitializableEvent); @@ -40,7 +40,7 @@ Note that even if the component doesn't define any events, the compiler will sti ---- #[starknet::contract] mod MyContract { - use openzeppelin_security::InitializableComponent; + use openzeppelin::security::InitializableComponent; component!(path: InitializableComponent, storage: initializable, event: InitializableEvent); @@ -79,7 +79,7 @@ Integrating an implementation looks like this: [,cairo] ---- mod MyContract { - use openzeppelin_security::InitializableComponent; + use openzeppelin::security::InitializableComponent; component!(path: InitializableComponent, storage: initializable, event: InitializableEvent); @@ -99,7 +99,7 @@ A function on the contract level can expose it like this: ---- #[starknet::contract] mod MyContract { - use openzeppelin_security::InitializableComponent; + use openzeppelin::security::InitializableComponent; component!(path: InitializableComponent, storage: initializable, event: InitializableEvent); @@ -202,8 +202,8 @@ Here's a full example of an account contract that embeds the `AccountMixinImpl`: ---- #[starknet::contract] mod Account { - use openzeppelin_account::AccountComponent; - use openzeppelin_introspection::src5::SRC5Component; + use openzeppelin::account::AccountComponent; + use openzeppelin::introspection::src5::SRC5Component; component!(path: AccountComponent, storage: account, event: AccountEvent); component!(path: SRC5Component, storage: src5, event: SRC5Event); @@ -298,7 +298,7 @@ Creating a contract with `AccessControlComponent` should look like this: #[starknet::contract] mod MyContract { use openzeppelinaccess::accesscontrol::AccessControlComponent; - use openzeppelin_introspection::src5::SRC5Component; + use openzeppelin::introspection::src5::SRC5Component; component!(path: AccessControlComponent, storage: accesscontrol, event: AccessControlEvent); component!(path: SRC5Component, storage: src5, event: SRC5Event); @@ -358,10 +358,10 @@ Here's the setup: ---- #[starknet::contract] mod ERC20Pausable { - use openzeppelin_security::pausable::PausableComponent; - use openzeppelin_token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; + use openzeppelin::security::pausable::PausableComponent; + use openzeppelin::token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; // Import the ERC20 interfaces to create custom implementations - use openzeppelin_token::erc20::interface::{IERC20, IERC20CamelOnly}; + use openzeppelin::token::erc20::interface::{IERC20, IERC20CamelOnly}; use starknet::ContractAddress; component!(path: PausableComponent, storage: pausable, event: PausableEvent); @@ -462,7 +462,7 @@ To do so, use the same syntax as calling an implementation method except replace ---- #[starknet::contract] mod MyContract { - use openzeppelin_security::InitializableComponent; + use openzeppelin::security::InitializableComponent; component!(path: InitializableComponent, storage: initializable, event: InitializableEvent); diff --git a/docs/modules/ROOT/pages/erc1155.adoc b/docs/modules/ROOT/pages/erc1155.adoc index 87f593660..78cdc322b 100644 --- a/docs/modules/ROOT/pages/erc1155.adoc +++ b/docs/modules/ROOT/pages/erc1155.adoc @@ -34,8 +34,8 @@ Here's an example of a basic contract: ---- #[starknet::contract] mod MyERC1155 { - use openzeppelin_introspection::src5::SRC5Component; - use openzeppelin_token::erc1155::{ERC1155Component, ERC1155HooksEmptyImpl}; + use openzeppelin::introspection::src5::SRC5Component; + use openzeppelin::token::erc1155::{ERC1155Component, ERC1155HooksEmptyImpl}; use starknet::ContractAddress; component!(path: ERC1155Component, storage: erc1155, event: ERC1155Event); @@ -227,8 +227,8 @@ Here's an example of a simple token receiver contract: ---- #[starknet::contract] mod MyTokenReceiver { - use openzeppelin_introspection::src5::SRC5Component; - use openzeppelin_token::erc1155::ERC1155ReceiverComponent; + use openzeppelin::introspection::src5::SRC5Component; + use openzeppelin::token::erc1155::ERC1155ReceiverComponent; use starknet::ContractAddress; component!(path: ERC1155ReceiverComponent, storage: erc1155_receiver, event: ERC1155ReceiverEvent); diff --git a/docs/modules/ROOT/pages/erc20.adoc b/docs/modules/ROOT/pages/erc20.adoc index b73124f12..67d100db9 100644 --- a/docs/modules/ROOT/pages/erc20.adoc +++ b/docs/modules/ROOT/pages/erc20.adoc @@ -23,7 +23,7 @@ Here's what that looks like: ---- #[starknet::contract] mod MyToken { - use openzeppelin_token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; + use openzeppelin::token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; use starknet::ContractAddress; component!(path: ERC20Component, storage: erc20, event: ERC20Event); @@ -170,7 +170,7 @@ TIP: Note that we are not using the MixinImpl in this case, since we need to cus ---- #[starknet::contract] mod MyToken { - use openzeppelin_token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; + use openzeppelin::token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; use starknet::ContractAddress; component!(path: ERC20Component, storage: erc20, event: ERC20Event); diff --git a/docs/modules/ROOT/pages/erc721.adoc b/docs/modules/ROOT/pages/erc721.adoc index b4166ae12..33c250ebf 100644 --- a/docs/modules/ROOT/pages/erc721.adoc +++ b/docs/modules/ROOT/pages/erc721.adoc @@ -18,8 +18,8 @@ Here's an example of a basic contract: ---- #[starknet::contract] mod MyNFT { - use openzeppelin_introspection::src5::SRC5Component; - use openzeppelin_token::erc721::{ERC721Component, ERC721HooksEmptyImpl}; + use openzeppelin::introspection::src5::SRC5Component; + use openzeppelin::token::erc721::{ERC721Component, ERC721HooksEmptyImpl}; use starknet::ContractAddress; component!(path: ERC721Component, storage: erc721, event: ERC721Event); @@ -195,8 +195,8 @@ Here's an example of a simple token receiver contract: ---- #[starknet::contract] mod MyTokenReceiver { - use openzeppelin_introspection::src5::SRC5Component; - use openzeppelin_token::erc721::ERC721ReceiverComponent; + use openzeppelin::introspection::src5::SRC5Component; + use openzeppelin::token::erc721::ERC721ReceiverComponent; use starknet::ContractAddress; component!(path: ERC721ReceiverComponent, storage: erc721_receiver, event: ERC721ReceiverEvent); diff --git a/docs/modules/ROOT/pages/guides/erc20-supply.adoc b/docs/modules/ROOT/pages/guides/erc20-supply.adoc index 71543e19d..a1c86340e 100644 --- a/docs/modules/ROOT/pages/guides/erc20-supply.adoc +++ b/docs/modules/ROOT/pages/guides/erc20-supply.adoc @@ -15,7 +15,7 @@ We can achieve this by setting the token supply in the constructor which will ex ---- #[starknet::contract] mod MyToken { - use openzeppelin_token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; + use openzeppelin::token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; use starknet::ContractAddress; component!(path: ERC20Component, storage: erc20, event: ERC20Event); @@ -69,7 +69,7 @@ Let's make a few changes to the almighty `MyToken` contract and create a minting ---- #[starknet::contract] mod MyToken { - use openzeppelin_token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; + use openzeppelin::token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; use starknet::ContractAddress; component!(path: ERC20Component, storage: erc20, event: ERC20Event); diff --git a/docs/modules/ROOT/pages/guides/snip12.adoc b/docs/modules/ROOT/pages/guides/snip12.adoc index 18b8f5181..fb919e065 100644 --- a/docs/modules/ROOT/pages/guides/snip12.adoc +++ b/docs/modules/ROOT/pages/guides/snip12.adoc @@ -26,7 +26,7 @@ Note that some declarations are omitted for brevity. The full example will be av ---- #[starknet::contract] mod CustomERC20 { - use openzeppelin_token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; + use openzeppelin::token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; use starknet::ContractAddress; component!(path: ERC20Component, storage: erc20, event: ERC20Event); @@ -117,12 +117,12 @@ NOTE: In practice it's better to compute the type hash off-chain and hardcode it === 3. Implement the `StructHash` trait for the struct. -You can import the trait from: `openzeppelin_utils::snip12::StructHash`. And this implementation +You can import the trait from: `openzeppelin::utils::snip12::StructHash`. And this implementation is nothing more than the encoding of the message as defined in the {snip}. [,cairo] ---- -use openzeppelin_utils::snip12::StructHash; +use openzeppelin::utils::snip12::StructHash; use core::hash::HashStateExTrait; use hash::{HashStateTrait, Hash}; @@ -155,7 +155,7 @@ because the `chain_id` is obtained on-chain, and the `revision` is hardcoded to [,cairo] ---- -use openzeppelin_utils::snip12::SNIP12Metadata; +use openzeppelin::utils::snip12::SNIP12Metadata; impl SNIP12MetadataImpl of SNIP12Metadata { fn name() -> felt252 { 'DAPP_NAME' } @@ -169,7 +169,7 @@ the trait is not bounded to the ContractState, like this: [,cairo] ---- -use openzeppelin_utils::snip12::SNIP12Metadata; +use openzeppelin::utils::snip12::SNIP12Metadata; impl SNIP12MetadataImpl of SNIP12Metadata { fn name() -> felt252 { @@ -190,7 +190,7 @@ using the `get_message_hash` function. The implementation is already available a [,cairo] ---- -use openzeppelin_utils::snip12::{SNIP12Metadata, StructHash, OffchainMessageHashImpl}; +use openzeppelin::utils::snip12::{SNIP12Metadata, StructHash, OffchainMessageHashImpl}; use core::hash::HashStateExTrait; use hash::{HashStateTrait, Hash}; @@ -251,7 +251,7 @@ and the {nonces}[`NoncesComponent`] to handle nonces to prevent replay attacks. [,cairo] ---- -use openzeppelin_utils::snip12::{SNIP12Metadata, StructHash, OffchainMessageHashImpl}; +use openzeppelin::utils::snip12::{SNIP12Metadata, StructHash, OffchainMessageHashImpl}; use core::hash::HashStateExTrait; use hash::{HashStateTrait, Hash}; @@ -278,9 +278,9 @@ impl StructHashImpl of StructHash { #[starknet::contract] mod CustomERC20 { - use openzeppelin_account::dual_account::{DualCaseAccount, DualCaseAccountABI}; - use openzeppelin_token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; - use openzeppelin_utils::cryptography::nonces::NoncesComponent; + use openzeppelin::account::dual_account::{DualCaseAccount, DualCaseAccountABI}; + use openzeppelin::token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; + use openzeppelin::utils::cryptography::nonces::NoncesComponent; use starknet::ContractAddress; use super::{Message, OffchainMessageHashImpl, SNIP12Metadata}; diff --git a/docs/modules/ROOT/pages/guides/src5-migration.adoc b/docs/modules/ROOT/pages/guides/src5-migration.adoc index b12eb5239..5f97d5ee3 100644 --- a/docs/modules/ROOT/pages/guides/src5-migration.adoc +++ b/docs/modules/ROOT/pages/guides/src5-migration.adoc @@ -36,8 +36,8 @@ Here's the setup: ---- #[starknet::contract] mod MigratingContract { - use openzeppelin_introspection::src5::SRC5Component; - use openzeppelin_security::initializable::InitializableComponent; + use openzeppelin::introspection::src5::SRC5Component; + use openzeppelin::security::initializable::InitializableComponent; component!(path: SRC5Component, storage: src5, event: SRC5Event); component!(path: InitializableComponent, storage: initializable, event: InitializableEvent); @@ -84,7 +84,7 @@ The contract should implement an `InternalImpl` and add a function to register t ---- #[starknet::contract] mod MigratingContract { - use openzeppelin_token::erc721::interface::{IERC721_ID, IERC721_METADATA_ID}; + use openzeppelin::token::erc721::interface::{IERC721_ID, IERC721_METADATA_ID}; (...) diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc index 910848493..41e20d036 100644 --- a/docs/modules/ROOT/pages/index.adoc +++ b/docs/modules/ROOT/pages/index.adoc @@ -71,7 +71,7 @@ Copy the code into `src/lib.cairo`. ---- #[starknet::contract] mod MyERC20Token { - use openzeppelin_token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; + use openzeppelin::token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; use starknet::ContractAddress; component!(path: ERC20Component, storage: erc20, event: ERC20Event); diff --git a/docs/modules/ROOT/pages/interfaces.adoc b/docs/modules/ROOT/pages/interfaces.adoc index 36462d458..d6e6a7fc8 100644 --- a/docs/modules/ROOT/pages/interfaces.adoc +++ b/docs/modules/ROOT/pages/interfaces.adoc @@ -7,13 +7,13 @@ This section describes the interfaces OpenZeppelin Contracts for Cairo offer, an Interfaces can be found in the module tree under the `interface` submodule, such as `token::erc20::interface`. For example: ```cairo -use openzeppelin_token::erc20::interface::IERC20; +use openzeppelin::token::erc20::interface::IERC20; ``` or ```cairo -use openzeppelin_token::erc20::dual20::DualCaseERC20; +use openzeppelin::token::erc20::dual20::DualCaseERC20; ``` NOTE: For simplicity, we'll use ERC20 as example but the same concepts apply to other modules. diff --git a/docs/modules/ROOT/pages/introspection.adoc b/docs/modules/ROOT/pages/introspection.adoc index 18a4f0bff..d4c9a4170 100644 --- a/docs/modules/ROOT/pages/introspection.adoc +++ b/docs/modules/ROOT/pages/introspection.adoc @@ -26,7 +26,7 @@ Here is an example contract: ---- #[starknet::contract] mod MyContract { - use openzeppelin_introspection::src5::SRC5Component; + use openzeppelin::introspection::src5::SRC5Component; component!(path: SRC5Component, storage: src5, event: SRC5Event); @@ -82,8 +82,8 @@ For a contract to declare its support for a given interface, we recommend using ---- #[starknet::contract] mod MyContract { - use openzeppelin_account::interface; - use openzeppelin_introspection::src5::SRC5Component; + use openzeppelin::account::interface; + use openzeppelin::introspection::src5::SRC5Component; component!(path: SRC5Component, storage: src5, event: SRC5Event); @@ -122,9 +122,9 @@ Use the `supports_interface` function to query a contract's support for a given ---- #[starknet::contract] mod MyContract { - use openzeppelin_account::interface; - use openzeppelin_introspection::interface::ISRC5DispatcherTrait; - use openzeppelin_introspection::interface::ISRC5Dispatcher; + use openzeppelin::account::interface; + use openzeppelin::introspection::interface::ISRC5DispatcherTrait; + use openzeppelin::introspection::interface::ISRC5Dispatcher; use starknet::ContractAddress; #[storage] diff --git a/docs/modules/ROOT/pages/presets.adoc b/docs/modules/ROOT/pages/presets.adoc index 18f1e02d2..3f56743f1 100644 --- a/docs/modules/ROOT/pages/presets.adoc +++ b/docs/modules/ROOT/pages/presets.adoc @@ -76,10 +76,10 @@ Copy the target preset contract from the {presets_dir} and paste it in the new p #[starknet::contract] mod ERC20Upgradeable { - use openzeppelin_access::ownable::OwnableComponent; - use openzeppelin_token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; - use openzeppelin_upgrades::UpgradeableComponent; - use openzeppelin_upgrades::interface::IUpgradeable; + use openzeppelin::access::ownable::OwnableComponent; + use openzeppelin::token::erc20::{ERC20Component, ERC20HooksEmptyImpl}; + use openzeppelin::upgrades::UpgradeableComponent; + use openzeppelin::upgrades::interface::IUpgradeable; use starknet::{ContractAddress, ClassHash}; component!(path: OwnableComponent, storage: ownable, event: OwnableEvent); diff --git a/docs/modules/ROOT/pages/security.adoc b/docs/modules/ROOT/pages/security.adoc index b3d44c1ae..9ccfe9c1a 100644 --- a/docs/modules/ROOT/pages/security.adoc +++ b/docs/modules/ROOT/pages/security.adoc @@ -1,6 +1,6 @@ = Security -The following documentation provides context, reasoning, and examples of modules found under `openzeppelin_security`. +The following documentation provides context, reasoning, and examples of modules found under `openzeppelin::security`. CAUTION: Expect these modules to evolve. @@ -18,7 +18,7 @@ You can use the component in your contracts like this: ---- #[starknet::contract] mod MyInitializableContract { - use openzeppelin_security::InitializableComponent; + use openzeppelin::security::InitializableComponent; component!(path: InitializableComponent, storage: initializable, event: InitializableEvent); @@ -82,8 +82,8 @@ For example (using the xref:api/access.adoc#OwnableComponent[Ownable] component ---- #[starknet::contract] mod MyPausableContract { - use openzeppelin_access::ownable::OwnableComponent; - use openzeppelin_security::PausableComponent; + use openzeppelin::access::ownable::OwnableComponent; + use openzeppelin::security::PausableComponent; use starknet::ContractAddress; component!(path: OwnableComponent, storage: ownable, event: OwnableEvent); @@ -176,7 +176,7 @@ The protected function must call `start` before the first function statement, an ---- #[starknet::contract] mod MyReentrancyContract { - use openzeppelin_security::ReentrancyGuardComponent; + use openzeppelin::security::ReentrancyGuardComponent; component!( path: ReentrancyGuardComponent, storage: reentrancy_guard, event: ReentrancyGuardEvent diff --git a/docs/modules/ROOT/pages/udc.adoc b/docs/modules/ROOT/pages/udc.adoc index 823ee7c96..fd30ce729 100644 --- a/docs/modules/ROOT/pages/udc.adoc +++ b/docs/modules/ROOT/pages/udc.adoc @@ -41,7 +41,7 @@ Here's an implementation example in Cairo: [,cairo] ---- -use openzeppelin_utils::interfaces::{IUniversalDeployerDispatcher, IUniversalDeployerDispatcherTrait}; +use openzeppelin::utils::interfaces::{IUniversalDeployerDispatcher, IUniversalDeployerDispatcherTrait}; const UDC_ADDRESS: felt252 = 0x04a64cd09a853868621d94cae9952b106f2c36a3f81260f85de6696c6b050221; diff --git a/docs/modules/ROOT/pages/upgrades.adoc b/docs/modules/ROOT/pages/upgrades.adoc index bceb25fdf..3f58469e0 100644 --- a/docs/modules/ROOT/pages/upgrades.adoc +++ b/docs/modules/ROOT/pages/upgrades.adoc @@ -51,9 +51,9 @@ NOTE: We will be using the following module to implement the {i_upgradeable} int ---- #[starknet::contract] mod UpgradeableContract { - use openzeppelin_access::ownable::OwnableComponent; - use openzeppelin_upgrades::UpgradeableComponent; - use openzeppelin_upgrades::interface::IUpgradeable; + use openzeppelin::access::ownable::OwnableComponent; + use openzeppelin::upgrades::UpgradeableComponent; + use openzeppelin::upgrades::interface::IUpgradeable; use starknet::ClassHash; use starknet::ContractAddress;