Skip to content

Commit

Permalink
doc: update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ericnordelo committed Jul 29, 2024
1 parent 0af0fff commit 15d5fcb
Show file tree
Hide file tree
Showing 28 changed files with 143 additions and 144 deletions.
1 change: 0 additions & 1 deletion Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
22 changes: 11 additions & 11 deletions docs/modules/ROOT/pages/access.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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};
Expand Down Expand Up @@ -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};
Expand Down
20 changes: 10 additions & 10 deletions docs/modules/ROOT/pages/accounts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions docs/modules/ROOT/pages/api/access.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions docs/modules/ROOT/pages/api/account.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand Down Expand Up @@ -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}.

Expand Down Expand Up @@ -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}.

Expand Down Expand Up @@ -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].
Expand Down Expand Up @@ -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].
Expand Down
14 changes: 7 additions & 7 deletions docs/modules/ROOT/pages/api/erc1155.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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}.

Expand Down Expand Up @@ -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].

Expand Down Expand Up @@ -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 <<IERC1155,IERC1155>> and <<IERC1155MetadataURI,IERC1155MetadataURI>>.
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -547,7 +547,7 @@ See <<IERC1155-URI,IERC1155::URI>>.

[.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.
Expand Down Expand Up @@ -587,7 +587,7 @@ via <<IERC1155-safe_batch_transfer_from,IERC1155::safe_batch_transfer_from>> by

[.hljs-theme-dark]
```cairo
use openzeppelin_token::erc1155::ERC1155ReceiverComponent;
use openzeppelin::token::erc1155::ERC1155ReceiverComponent;
```

ERC1155Receiver component implementing <<IERC1155Receiver,IERC1155Receiver>>.
Expand Down Expand Up @@ -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].
Expand Down
12 changes: 6 additions & 6 deletions docs/modules/ROOT/pages/api/erc20.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand Down Expand Up @@ -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}.
Expand Down Expand Up @@ -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 <<IERC20,IERC20>> and <<IERC20Metadata,IERC20Metadata>>.

Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -463,7 +463,7 @@ See <<IERC20-Approval,IERC20::Approval>>.
=== `++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]
Expand Down Expand Up @@ -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.
Expand Down
14 changes: 7 additions & 7 deletions docs/modules/ROOT/pages/api/erc721.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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}.

Expand Down Expand Up @@ -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}.
Expand Down Expand Up @@ -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 <<IERC721,IERC721>> and <<IERC721Metadata,IERC721Metadata>>.
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -697,7 +697,7 @@ See <<IERC721-Transfer,IERC721::Transfer>>.

[.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.
Expand Down Expand Up @@ -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 <<IERC721Receiver,IERC721Receiver>>.
Expand Down Expand Up @@ -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].
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/api/governance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/api/introspection.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand Down Expand Up @@ -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`].
Expand Down
Loading

0 comments on commit 15d5fcb

Please sign in to comment.