Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update upgrade docs #731

Merged
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
191 commits
Select commit Hold shift + click to select a range
49baf23
feat: update format and add api
ericnordelo Aug 23, 2023
6ba12a9
fix: typo
ericnordelo Aug 23, 2023
38a7363
feat: add counterfactual deployment doc
ericnordelo Aug 24, 2023
06d3384
feat: add API entries
ericnordelo Aug 24, 2023
48e77cf
feat: add events
ericnordelo Aug 24, 2023
2cce06a
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Aug 25, 2023
71cc37d
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Aug 25, 2023
a34020e
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Aug 25, 2023
60305e7
Update docs/modules/ROOT/pages/guides/deployment.adoc
ericnordelo Aug 25, 2023
2223482
Update docs/modules/ROOT/pages/guides/deployment.adoc
ericnordelo Aug 25, 2023
1ae6d18
feat: update from reviews
ericnordelo Aug 25, 2023
849739d
Merge branch 'feat/update-account-docs-#560' of github.com:ericnordel…
ericnordelo Aug 25, 2023
7a9f38e
feat: apply review updates
ericnordelo Aug 25, 2023
72b4e75
Merge branch 'cairo-2' of github.com:OpenZeppelin/cairo-contracts int…
ericnordelo Aug 28, 2023
e809b1f
feat: update docs
ericnordelo Aug 29, 2023
2c3b734
feat: update docs
ericnordelo Aug 30, 2023
12a10d3
Merge branch 'feat/update-account-docs-#560' into feat/update-access-…
ericnordelo Aug 30, 2023
4982b4e
feat: update from account docs
ericnordelo Aug 30, 2023
8c41b10
feat: update main page
ericnordelo Aug 30, 2023
fbc18fb
Update docs/modules/ROOT/pages/api/account.adoc
ericnordelo Aug 31, 2023
b235619
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Aug 31, 2023
13248e4
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Aug 31, 2023
cdf7bd2
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Aug 31, 2023
bea7e8d
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Aug 31, 2023
437b196
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Aug 31, 2023
d3ffdf4
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Aug 31, 2023
0d8bdce
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Aug 31, 2023
964e58b
Update docs/modules/ROOT/pages/api/account.adoc
ericnordelo Aug 31, 2023
99fa76f
Update docs/modules/ROOT/pages/api/account.adoc
ericnordelo Aug 31, 2023
e5afaeb
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Aug 31, 2023
56715e7
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Aug 31, 2023
a596957
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Aug 31, 2023
c5d1466
Update docs/modules/ROOT/pages/guides/deployment.adoc
ericnordelo Aug 31, 2023
022d8bd
Update docs/modules/ROOT/pages/guides/deployment.adoc
ericnordelo Aug 31, 2023
4ede5cc
Update docs/modules/ROOT/pages/guides/deployment.adoc
ericnordelo Aug 31, 2023
f007a1f
Update docs/modules/ROOT/pages/guides/deployment.adoc
ericnordelo Aug 31, 2023
76ce366
Update docs/modules/ROOT/pages/api/account.adoc
ericnordelo Aug 31, 2023
207662c
Update docs/modules/ROOT/pages/api/account.adoc
ericnordelo Aug 31, 2023
699a27a
Update docs/modules/ROOT/pages/api/account.adoc
ericnordelo Aug 31, 2023
29b23f4
Update docs/modules/ROOT/pages/api/account.adoc
ericnordelo Aug 31, 2023
19b8372
Update docs/modules/ROOT/pages/api/account.adoc
ericnordelo Aug 31, 2023
d909516
Update docs/modules/ROOT/pages/api/account.adoc
ericnordelo Aug 31, 2023
8c23b4c
feat: apply review updates
ericnordelo Aug 31, 2023
8741eea
Merge branch 'feat/update-account-docs-#560' of github.com:ericnordel…
ericnordelo Aug 31, 2023
501b241
fix: account casing
ericnordelo Aug 31, 2023
5b33694
feat: add headers
ericnordelo Aug 31, 2023
e781bfd
Update docs/modules/ROOT/pages/api/account.adoc
ericnordelo Aug 31, 2023
7fdf47b
feat: add link
ericnordelo Aug 31, 2023
448a015
Merge branch 'feat/update-account-docs-#560' of github.com:ericnordel…
ericnordelo Aug 31, 2023
1269a08
Merge branch 'feat/update-account-docs-#560' into feat/update-access-…
ericnordelo Aug 31, 2023
77da367
feat: move API
ericnordelo Sep 1, 2023
dbc9fd4
Merge branch 'feat/update-account-docs-#560' into feat/update-access-…
ericnordelo Sep 1, 2023
47b8c32
Merge branch 'feat/update-access-control-docs-#561' into feat/update-…
ericnordelo Sep 1, 2023
ae6e30c
feat: add event references
ericnordelo Sep 1, 2023
3ba7646
Merge branch 'feat/update-access-control-docs-#561' into feat/update-…
ericnordelo Sep 1, 2023
d995f77
feat: update API
ericnordelo Sep 1, 2023
76fd058
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Sep 11, 2023
0342dfc
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Sep 11, 2023
7e5a3ec
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Sep 11, 2023
f3cccac
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Sep 11, 2023
0f4583d
refactor: update wording
ericnordelo Sep 11, 2023
7a2db69
Merge branch 'feat/update-account-docs-#560' of github.com:ericnordel…
ericnordelo Sep 11, 2023
55287f4
Merge branch 'cairo-2' of github.com:OpenZeppelin/cairo-contracts int…
ericnordelo Sep 11, 2023
039fb1f
Update docs/antora.yml
ericnordelo Sep 11, 2023
2f51db7
Update docs/modules/ROOT/pages/api/account.adoc
ericnordelo Sep 11, 2023
bf2543c
Update docs/modules/ROOT/pages/api/account.adoc
ericnordelo Sep 11, 2023
eba2992
feat: apply update reviews
ericnordelo Sep 11, 2023
0fe2d86
Merge branch 'feat/update-account-docs-#560' of github.com:ericnordel…
ericnordelo Sep 11, 2023
694b3a2
Update docs/modules/ROOT/pages/api/account.adoc
ericnordelo Sep 11, 2023
5de23f2
refactor: UI
ericnordelo Sep 11, 2023
717f548
fix: UI
ericnordelo Sep 11, 2023
a5d6f94
feat: focus on SRC6
ericnordelo Sep 11, 2023
a4fa8ab
Merge branch 'feat/update-account-docs-#560' into feat/update-access-…
ericnordelo Sep 11, 2023
68e59be
Update docs/modules/ROOT/pages/api/access.adoc
ericnordelo Sep 11, 2023
5199827
Update docs/modules/ROOT/pages/api/access.adoc
ericnordelo Sep 11, 2023
0052f4c
Update docs/modules/ROOT/pages/api/access.adoc
ericnordelo Sep 11, 2023
aa81069
Update docs/modules/ROOT/pages/api/access.adoc
ericnordelo Sep 11, 2023
d897104
feat: apply review updates
ericnordelo Sep 11, 2023
d812951
Merge branch 'feat/update-access-control-docs-#561' of github.com:eri…
ericnordelo Sep 11, 2023
e681966
Merge branch 'feat/update-access-control-docs-#561' into feat/update-…
ericnordelo Sep 11, 2023
50e99e3
Update docs/modules/ROOT/pages/introspection.adoc
ericnordelo Sep 11, 2023
ea977fd
Update docs/modules/ROOT/pages/introspection.adoc
ericnordelo Sep 11, 2023
6f54ad8
Update docs/modules/ROOT/pages/introspection.adoc
ericnordelo Sep 11, 2023
e923c76
Update docs/modules/ROOT/pages/introspection.adoc
ericnordelo Sep 11, 2023
13dc338
Update docs/modules/ROOT/pages/introspection.adoc
ericnordelo Sep 11, 2023
671da7f
Update docs/modules/ROOT/pages/introspection.adoc
ericnordelo Sep 11, 2023
c301523
Update docs/modules/ROOT/pages/api/introspection.adoc
ericnordelo Sep 11, 2023
27c819c
Merge branch 'feat/update-introspection-docs-#567' of github.com:eric…
ericnordelo Sep 11, 2023
3924b16
feat: finish v1
ericnordelo Sep 13, 2023
184b536
Update docs/modules/ROOT/pages/accounts.adoc
ericnordelo Sep 14, 2023
000672a
feat: apply review updates
ericnordelo Sep 15, 2023
caea081
Merge branch 'feat/update-account-docs-#560' of github.com:ericnordel…
ericnordelo Sep 15, 2023
cacfc12
Update docs/modules/ROOT/pages/access.adoc
ericnordelo Sep 15, 2023
285ec60
Update docs/modules/ROOT/pages/access.adoc
ericnordelo Sep 15, 2023
bbeb586
Merge branch 'feat/update-account-docs-#560' into feat/update-access-…
ericnordelo Sep 15, 2023
f1c86bb
Update docs/modules/ROOT/pages/access.adoc
ericnordelo Sep 15, 2023
99d1acb
feat: apply review updates
ericnordelo Sep 15, 2023
c1b7540
Merge branch 'feat/update-access-control-docs-#561' of github.com:eri…
ericnordelo Sep 15, 2023
2e690e7
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 15, 2023
f5aefe9
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 15, 2023
73aadcd
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 15, 2023
2dccfd8
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 15, 2023
d807d7c
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 15, 2023
559194b
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 15, 2023
ff19c20
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 15, 2023
a6fdcc7
feat: apply review updates
ericnordelo Sep 15, 2023
3d853cc
Merge branch 'feat/update-upgrade-docs-#559' of github.com:ericnordel…
ericnordelo Sep 15, 2023
a5656f7
Update docs/modules/ROOT/pages/introspection.adoc
ericnordelo Sep 18, 2023
71a204b
Update docs/modules/ROOT/pages/introspection.adoc
ericnordelo Sep 18, 2023
77a1bac
Update docs/modules/ROOT/pages/introspection.adoc
ericnordelo Sep 18, 2023
2ef51de
Update docs/modules/ROOT/pages/introspection.adoc
ericnordelo Sep 18, 2023
a40678d
Update docs/modules/ROOT/pages/api/introspection.adoc
ericnordelo Sep 18, 2023
faf9689
Update docs/modules/ROOT/pages/api/introspection.adoc
ericnordelo Sep 18, 2023
a1deff4
Update docs/modules/ROOT/pages/api/introspection.adoc
ericnordelo Sep 18, 2023
5329273
Merge branch 'feat/update-access-control-docs-#561' into feat/update-…
ericnordelo Sep 18, 2023
45d321e
Merge branch 'feat/update-introspection-docs-#567' of github.com:eric…
ericnordelo Sep 18, 2023
8c27ff3
feat: moving external functions on top
ericnordelo Sep 18, 2023
c1da55e
feat: add example
ericnordelo Sep 18, 2023
270610b
Merge branch 'cairo-2' of github.com:OpenZeppelin/cairo-contracts int…
ericnordelo Sep 18, 2023
b157eb9
feat: apply review updates
ericnordelo Sep 18, 2023
7a4d1d2
Merge branch 'cairo-2' of github.com:OpenZeppelin/cairo-contracts int…
ericnordelo Sep 18, 2023
2feac36
Merge branch 'feat/update-access-control-docs-#561' into feat/update-…
ericnordelo Sep 18, 2023
215f361
Merge branch 'cairo-2' of github.com:OpenZeppelin/cairo-contracts int…
ericnordelo Sep 18, 2023
5158c59
Merge branch 'feat/update-introspection-docs-#567' into feat/update-u…
ericnordelo Sep 18, 2023
706c9b7
Update docs/modules/ROOT/pages/introspection.adoc
ericnordelo Sep 19, 2023
ae0e339
Update docs/modules/ROOT/pages/introspection.adoc
ericnordelo Sep 19, 2023
9716ecf
Update docs/modules/ROOT/pages/introspection.adoc
ericnordelo Sep 19, 2023
406e289
Update docs/modules/ROOT/pages/introspection.adoc
ericnordelo Sep 19, 2023
580dbbd
Update docs/modules/ROOT/pages/api/introspection.adoc
ericnordelo Sep 19, 2023
bf6e349
Update docs/modules/ROOT/pages/api/introspection.adoc
ericnordelo Sep 19, 2023
3c270b7
feat: apply update reviews
ericnordelo Sep 19, 2023
d39f80b
Merge branch 'feat/update-introspection-docs-#567' of github.com:eric…
ericnordelo Sep 19, 2023
c980dd6
feat: apply update reviews
ericnordelo Sep 19, 2023
195087c
refactor: fmt files
ericnordelo Sep 19, 2023
27c1c7f
Update docs/modules/ROOT/pages/introspection.adoc
ericnordelo Sep 19, 2023
6bd6c92
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 22, 2023
f0b8439
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 22, 2023
3db1be5
Merge branch 'cairo-2' of github.com:OpenZeppelin/cairo-contracts int…
ericnordelo Sep 22, 2023
2a26c1a
Merge branch 'feat/update-upgrade-docs-#559' of github.com:ericnordel…
ericnordelo Sep 22, 2023
c4a1ff8
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 22, 2023
d56de53
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 22, 2023
d999ce0
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 22, 2023
dc9a9b6
Update docs/modules/ROOT/pages/api/upgrades.adoc
ericnordelo Sep 22, 2023
ee8feb3
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 22, 2023
7313bbc
feat: apply review updates
ericnordelo Sep 22, 2023
e810d9e
Merge branch 'feat/update-upgrade-docs-#559' of github.com:ericnordel…
ericnordelo Sep 22, 2023
8093eda
Update docs/modules/ROOT/pages/introspection.adoc
ericnordelo Sep 22, 2023
e48de31
feat: apply review updates
ericnordelo Sep 22, 2023
48529c3
Merge branch 'feat/update-introspection-docs-#567' of github.com:eric…
ericnordelo Sep 22, 2023
26cbfa1
Merge branch 'cairo-2' of github.com:OpenZeppelin/cairo-contracts int…
ericnordelo Sep 22, 2023
9943beb
feat: apply update reviews
ericnordelo Sep 22, 2023
01f2414
Update docs/modules/ROOT/pages/api/access.adoc
ericnordelo Sep 22, 2023
b31322f
Update docs/modules/ROOT/pages/api/access.adoc
ericnordelo Sep 22, 2023
72d8b8f
Update docs/modules/ROOT/pages/api/access.adoc
ericnordelo Sep 22, 2023
185af3e
Update docs/modules/ROOT/pages/api/access.adoc
ericnordelo Sep 22, 2023
27bb982
Merge branch 'cairo-2' of github.com:OpenZeppelin/cairo-contracts int…
ericnordelo Sep 22, 2023
ccf95e1
Merge branch 'feat/update-access-control-docs-#561' into feat/update-…
ericnordelo Sep 22, 2023
92bfaac
Merge branch 'feat/update-introspection-docs-#567' into feat/update-u…
ericnordelo Sep 22, 2023
4739e9a
feat: apply update reviews
ericnordelo Sep 23, 2023
d26fee1
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 23, 2023
d48033e
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 23, 2023
4a3b345
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 23, 2023
b225294
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 23, 2023
98e7b83
feat: apply review updates
ericnordelo Sep 23, 2023
3ddd081
Merge branch 'feat/update-upgrade-docs-#559' of github.com:ericnordel…
ericnordelo Sep 23, 2023
a6fad1a
Update docs/modules/ROOT/pages/access.adoc
ericnordelo Sep 23, 2023
92269dd
Update docs/modules/ROOT/pages/access.adoc
ericnordelo Sep 23, 2023
853ca70
feat: apply review updates
ericnordelo Sep 23, 2023
b4103a6
Merge branch 'feat/update-access-control-docs-#561' of github.com:eri…
ericnordelo Sep 23, 2023
048fc2d
Merge branch 'feat/update-access-control-docs-#561' into feat/update-…
ericnordelo Sep 23, 2023
8eedc00
Merge branch 'feat/update-introspection-docs-#567' into feat/update-u…
ericnordelo Sep 23, 2023
ec93323
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 26, 2023
5e72981
feat: apply review updates
ericnordelo Sep 26, 2023
e08f7b7
feat: remove sn_keccak in comments
ericnordelo Sep 26, 2023
efb4567
feat: apply review updates
ericnordelo Sep 26, 2023
917740f
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 26, 2023
eb76f75
Update docs/modules/ROOT/pages/upgrades.adoc
ericnordelo Sep 27, 2023
5d5f924
feat: replace cairo-2 with replace-0.7.0
ericnordelo Sep 27, 2023
071e731
Merge branch 'feat/update-access-control-docs-#561' into feat/update-…
ericnordelo Sep 27, 2023
f92fe46
feat: replace cairo-2 with replace-0.7.0
ericnordelo Sep 27, 2023
237e079
Merge branch 'feat/update-introspection-docs-#567' into feat/update-u…
ericnordelo Sep 27, 2023
19925c3
feat: replace cairo-2 with release-0.7.0
ericnordelo Sep 27, 2023
9eea9ae
Merge branch 'feat/update-upgrade-docs-#559' of github.com:ericnordel…
ericnordelo Sep 27, 2023
8ead1bd
feat: remove types
ericnordelo Sep 27, 2023
c8f493c
feat: remove grayed-out areas
ericnordelo Sep 27, 2023
dcfaaee
Merge branch 'feat/update-access-control-docs-#561' into feat/update-…
ericnordelo Sep 27, 2023
bb13792
feat: remove grayed-out areas
ericnordelo Sep 27, 2023
6414c0a
Merge branch 'feat/update-introspection-docs-#567' into feat/update-u…
ericnordelo Sep 27, 2023
217098a
feat: remove grayed-out areas
ericnordelo Sep 27, 2023
d1a4481
Merge branch 'cairo-2' of github.com:OpenZeppelin/cairo-contracts int…
ericnordelo Sep 29, 2023
5aa5505
feat: apply review update
ericnordelo Sep 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
* xref:index.adoc[Overview]
* xref:wizard.adoc[Wizard]
* xref:extensibility.adoc[Extensibility]
* xref:upgrades.adoc[Upgradeability]
//* xref:wizard.adoc[Wizard]
//* xref:extensibility.adoc[Extensibility]
* xref:interfaces.adoc[Interfaces and Dispatchers]
* xref:upgrades.adoc[Upgrades]
** xref:/api/upgrades.adoc[API Reference]

* xref:accounts.adoc[Accounts]
Expand All @@ -16,12 +17,12 @@
// ** xref:erc721.adoc[ERC721]
// ** xref:erc1155.adoc[ERC1155]

* xref:security.adoc[Security]
// * xref:security.adoc[Security]

* xref:introspection.adoc[Introspection]
** xref:/api/introspection.adoc[API Reference]

* xref:udc.adoc[Universal Deployer Contract]
* xref:utilities.adoc[Utilities]
// * xref:udc.adoc[Universal Deployer Contract]
// * xref:utilities.adoc[Utilities]

* xref:contracts::index.adoc[Contracts for Solidity]
14 changes: 7 additions & 7 deletions docs/modules/ROOT/pages/access.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ xref:/api/access.adoc#AccessControl-initializer[`initializer`] like this:
use openzeppelin::access::ownable::Ownable;

#[starknet::contract]
mod Contract {
mod MyContract {
use starknet::ContractAddress;
use super::Ownable;

Expand All @@ -50,7 +50,7 @@ To restrict a function's access to the owner only, add in the `assert_only_owner
[,javascript]
----
#[starknet::contract]
mod Contract {
mod MyContract {
use openzeppelin::access::ownable::Ownable;

(...)
Expand All @@ -68,7 +68,7 @@ mod Contract {

=== Interface

This is the full interface a contract must implement to be compliant with the `Ownable` implementation:
This is the full interface of the `Ownable` implementation:

[,javascript]
----
Expand Down Expand Up @@ -123,7 +123,7 @@ and sets a 'minter' role:
const MINTER_ROLE: felt252 = selector!('MINTER_ROLE');

#[starknet::contract]
mod Contract {
mod MyContract {
use openzeppelin::access::accesscontrol::AccessControl::InternalImpl::assert_only_role;
use openzeppelin::access::accesscontrol::AccessControl;
use openzeppelin::token::erc20::ERC20;
Expand Down Expand Up @@ -184,7 +184,7 @@ const MINTER_ROLE: felt252 = selector!('MINTER_ROLE');
const BURNER_ROLE: felt252 = selector!('BURNER_ROLE');

#[starknet::contract]
mod Contract {
mod MyContract {
use openzeppelin::access::accesscontrol::AccessControl::InternalImpl::assert_only_role;
use openzeppelin::access::accesscontrol::AccessControl;
use openzeppelin::token::erc20::ERC20;
Expand Down Expand Up @@ -284,7 +284,7 @@ const MINTER_ROLE: felt252 = selector!('MINTER_ROLE');
const BURNER_ROLE: felt252 = selector!('BURNER_ROLE');

#[starknet::contract]
mod Contract {
mod MyContract {
use openzeppelin::access::accesscontrol::AccessControl::InternalImpl::assert_only_role;
use openzeppelin::access::accesscontrol::AccessControl;
use openzeppelin::access::accesscontrol::DEFAULT_ADMIN_ROLE;
Expand Down Expand Up @@ -388,7 +388,7 @@ TIP: The `selector!` macro can be used to compute {sn_keccak} in Cairo.

=== Interface

This is the full interface a contract must implement to be compliant with the `AccessControl` implementation:
This is the full interface of the `AccessControl` implementation:

[,javascript]
----
Expand Down
95 changes: 41 additions & 54 deletions docs/modules/ROOT/pages/api/access.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
:AccessControl: xref:AccessControl[AccessControl]
:Ownable: xref:Ownable[Ownable]
:src5: https://github.com/starknet-io/SNIPs/blob/main/SNIPS/snip-5.md[SRC5]
:inner-src5: xref:api/introspection.adoc#ISRC5[SRC5]
:inner-src5: xref:api/introspection.adoc#ISRC5[SRC5 ID]
:_set_role_admin: xref:#AccessControl-_set_role_admin[_set_role_admin]

= Access Control

This directory provides ways to restrict who can access the functions of a contract or when they can do it.

- {Ownable} is a simple mechanism with a single owner "role" that can be assigned to a single account.
This mechanism can be useful for quick tests but projects with production concerns are likely to outgrow it.
- {Ownable} is a simple mechanism with a single "owner" role that can be assigned to a single account.
This mechanism can be useful in simple scenarios, but fine grained access needs are likely to outgrow it.
- {AccessControl} provides a general role based access control mechanism. Multiple hierarchical roles can be created and
assigned each to multiple accounts.

Expand All @@ -24,18 +24,10 @@ assigned each to multiple accounts.
use openzeppelin::access::ownable::Ownable;
```

Contract module which provides a basic access control mechanism, where
there is an account (an owner) that can be granted exclusive access to
specific functions.
`Ownable` provides a basic access control mechanism where an account
(an owner) can be granted exclusive access to specific functions.

This module provides an internal utility named `assert_only_owner`, which can be applied to your functions
to restrict their use to the owner.

[.contract-index]
.Utilities
--
* xref:Ownable-assert_only_owner[`++InternalImpl::assert_only_owner(self)++`]
--
This module includes the `assert_only_owner` internal to restrict a function to be used only by the owner.

[.contract-index]
.External Functions
Expand All @@ -44,8 +36,8 @@ to restrict their use to the owner.
.OwnableImpl

* xref:Ownable-owner[`++owner(self)++`]
* xref:Ownable-renounce_ownership[`++renounce_ownership(self)++`]
* xref:Ownable-transfer_ownership[`++transfer_ownership(self, new_owner)++`]
* xref:Ownable-renounce_ownership[`++renounce_ownership(self)++`]
--

[.contract-index]
Expand All @@ -56,6 +48,7 @@ to restrict their use to the owner.

* xref:Ownable-initializer[`++initializer(self, owner)++`]
* xref:Ownable-_transfer_ownership[`++_transfer_ownership(self, new_owner)++`]
* xref:Ownable-assert_only_owner[`++assert_only_owner(self)++`]
--

[.contract-index]
Expand All @@ -64,24 +57,24 @@ to restrict their use to the owner.
* xref:Ownable-OwnershipTransferred[`++OwnershipTransferred(previous_owner, new_owner)++`]
--

[#Ownable-Utilities]
==== Utilities

[.contract-item]
[[Ownable-assert_only_owner]]
==== `[.contract-item-name]#++assert_only_owner++#++(self: @ContractState)++` [.item-kind]#internal#

Panics if called by any account other than the owner.

[#Ownable-Functions]
==== Functions
[#Ownable-External-Functions]
==== External Functions

[.contract-item]
[[Ownable-owner]]
==== `[.contract-item-name]#++owner++#++(self: @ContractState) → ContractAddress++` [.item-kind]#external#

Returns the address of the current owner.

[.contract-item]
[[Ownable-transfer_ownership]]
==== `[.contract-item-name]#++transfer_ownership++#++(ref self: ContractState, new_owner: ContractAddress)++` [.item-kind]#external#

Transfers ownership of the contract to a new account (`new_owner`).
Can only be called by the current owner.

Emits an xref:Ownable-OwnershipTransferred[OwnershipTransferred] event.

[.contract-item]
[[Ownable-renounce_ownership--]]
==== `[.contract-item-name]#++renounce_ownership++#++(ref self: ContractState)++` [.item-kind]#external#
Expand All @@ -92,14 +85,8 @@ Leaves the contract without owner. It will not be possible to call
NOTE: Renouncing ownership will leave the contract without an owner,
thereby removing any functionality that is only available to the owner.

[.contract-item]
[[Ownable-transfer_ownership]]
==== `[.contract-item-name]#++transfer_ownership++#++(ref self: ContractState, new_owner: ContractAddress)++` [.item-kind]#external#

Transfers ownership of the contract to a new account (`new_owner`).
Can only be called by the current owner.

Emits an xref:Ownable-OwnershipTransferred[OwnershipTransferred] event.
[#Ownable-Internal-Functions]
==== Internal Functions

[.contract-item]
[[Ownable-initializer]]
Expand All @@ -118,6 +105,12 @@ Internal function without access restriction.

Emits an xref:Ownable-OwnershipTransferred[OwnershipTransferred] event.

[.contract-item]
[[Ownable-assert_only_owner]]
==== `[.contract-item-name]#++assert_only_owner++#++(self: @ContractState)++` [.item-kind]#internal#

Panics if called by any account other than the owner.

[#Ownable-Events]
==== Events

Expand All @@ -144,7 +137,7 @@ use openzeppelin::access::accesscontrol::interface::IAccessControl;
External interface of AccessControl.

[.contract-index]
.{inner-src5} ID
.{inner-src5}
--
0x23700be02858dbe2ac4dc9c9f66d0b6b0ed81ec7f970ca6844500a56ff61751
--
Expand Down Expand Up @@ -277,8 +270,7 @@ Roles are referred to by their `felt252` identifier:

```javascript
// sn_keccak('MY_ROLE')
const MY_ROLE: felt252 =
0x3c877e40edb41710f0baf588c878ee15a04499b06ae8c98cf488875d91a7213;
const MY_ROLE: felt252 = selector!('MY_ROLE');
```

Roles can be used to represent a set of permissions. To restrict access to a
Expand Down Expand Up @@ -312,12 +304,6 @@ WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
grant and revoke this role. Extra precautions should be taken to secure
accounts that have been granted it.

[.contract-index]
.Utilities
--
* xref:#AccessControl-assert_only_role[`++InternalImpl::assert_only_role(self, role)++`]
--

[.contract-index]
.External Functions
--
Expand Down Expand Up @@ -345,6 +331,7 @@ accounts that have been granted it.
* xref:#AccessControl-_set_role_admin[`++_set_role_admin(self, role, admin_role)++`]
* xref:#AccessControl-_grant_role[`++_grant_role(self, role, account)++`]
* xref:#AccessControl-_revoke_role[`++_revoke_role(self, role, account)++`]
* xref:#AccessControl-assert_only_role[`++assert_only_role(self, role)++`]
--

[.contract-index]
Expand All @@ -357,17 +344,8 @@ accounts that have been granted it.
* xref:#AccessControl-RoleRevoked[`++RoleRevoked(role, account, sender)++`]
--

[#AccessControl-Utilities]
==== Utilities

[.contract-item]
[[AccessControl-assert_only_role]]
==== `[.contract-item-name]#++assert_only_role++#++(self: @ContractState, role: felt252)++` [.item-kind]#internal#

Panics if called by any account without the given `role`.

[#AccessControl-Functions]
==== Functions
[#AccessControl-External-Functions]
==== External Functions

[.contract-item]
[[AccessControl-has_role]]
Expand Down Expand Up @@ -438,6 +416,9 @@ May emit a {RoleRevoked} event.

See xref:api/introspection.adoc#ISRC5-supports_interface[ISRC5::supports_interface].

[#AccessControl-Internal-Functions]
==== Internal Functions

[.contract-item]
[[AccessControl-initializer]]
==== `[.contract-item-name]#++initializer++#++(ref self: ContractState)++` [.item-kind]#internal#
Expand Down Expand Up @@ -472,6 +453,12 @@ Internal function without access restriction.

May emit a {RoleRevoked} event.

[.contract-item]
[[AccessControl-assert_only_role]]
==== `[.contract-item-name]#++assert_only_role++#++(self: @ContractState, role: felt252)++` [.item-kind]#internal#

Panics if called by any account without the given `role`.

[#AccessControl-Events]
==== Events

Expand Down
Loading