Skip to content

Commit

Permalink
Update upgrade docs (#731)
Browse files Browse the repository at this point in the history
* feat: update format and add api

* fix: typo

* feat: add counterfactual deployment doc

* feat: add API entries

* feat: add events

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* feat: update from reviews

* feat: apply review updates

* feat: update docs

* feat: update docs

* feat: update from account docs

* feat: update main page

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* fix: account casing

* feat: add headers

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: add link

* feat: move API

* feat: add event references

* feat: update API

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* refactor: update wording

* Update docs/antora.yml

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply update reviews

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* refactor: UI

* fix: UI

* feat: focus on SRC6

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* feat: apply review updates

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* feat: finish v1

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* Update docs/modules/ROOT/pages/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* feat: apply review updates

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/introspection.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/introspection.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/introspection.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: moving external functions on top

* feat: add example

* feat: apply review updates

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* feat: apply update reviews

* feat: apply update reviews

* refactor: fmt files

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/upgrades.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* feat: apply update reviews

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply update reviews

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* feat: apply review updates

* Update docs/modules/ROOT/pages/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* feat: remove sn_keccak in comments

* feat: apply review updates

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/upgrades.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: replace cairo-2 with replace-0.7.0

* feat: replace cairo-2 with replace-0.7.0

* feat: replace cairo-2 with release-0.7.0

* feat: remove types

* feat: remove grayed-out areas

* feat: remove grayed-out areas

* feat: remove grayed-out areas

* feat: apply review update

---------

Co-authored-by: Andrew Fleming <[email protected]>
Co-authored-by: Martín Triay <[email protected]>
  • Loading branch information
3 people authored Sep 29, 2023
1 parent 4ce5309 commit fe695e4
Show file tree
Hide file tree
Showing 10 changed files with 190 additions and 387 deletions.
3 changes: 2 additions & 1 deletion docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
* xref:index.adoc[Overview]
//* xref:wizard.adoc[Wizard]
//* xref:extensibility.adoc[Extensibility]
//* xref:proxies.adoc[Proxies and Upgrades]
* xref:interfaces.adoc[Interfaces and Dispatchers]
* xref:upgrades.adoc[Upgrades]
** xref:/api/upgrades.adoc[API Reference]
* xref:accounts.adoc[Accounts]
** xref:/guides/deployment.adoc[Counterfactual deployments]
Expand Down
25 changes: 0 additions & 25 deletions docs/modules/ROOT/pages/api/access.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,8 @@ This module includes the `assert_only_owner` internal to restrict a function to
.InternalImpl

* xref:Ownable-initializer[`++initializer(self, owner)++`]
<<<<<<< HEAD
* xref:Ownable-_transfer_ownership[`++_transfer_ownership(self, new_owner)++`]
* xref:Ownable-assert_only_owner[`++assert_only_owner(self)++`]
=======
* xref:Ownable-assert_only_owner[`++assert_only_owner(self)++`]
* xref:Ownable-_transfer_ownership[`++_transfer_ownership(self, new_owner)++`]
>>>>>>> 2ac98beefbed0770d4dddd094575f14a5305df4d
--

[.contract-index]
Expand Down Expand Up @@ -79,11 +74,7 @@ Can only be called by the current owner.
Emits an xref:Ownable-OwnershipTransferred[OwnershipTransferred] event.

[.contract-item]
<<<<<<< HEAD
[[Ownable-renounce_ownership--]]
=======
[[Ownable-renounce_ownership]]
>>>>>>> 2ac98beefbed0770d4dddd094575f14a5305df4d
==== `[.contract-item-name]#++renounce_ownership++#++(ref self: ContractState)++` [.item-kind]#external#

Leaves the contract without owner. It will not be possible to call
Expand All @@ -99,24 +90,17 @@ thereby removing any functionality that is only available to the owner.
[[Ownable-initializer]]
==== `[.contract-item-name]#++initializer++#++(ref self: ContractState, owner: ContractAddress)++` [.item-kind]#internal#

<<<<<<< HEAD
Initializes the contract setting `owner` as the initial owner.
=======
Initializes the contract and sets `owner` as the initial owner.
>>>>>>> 2ac98beefbed0770d4dddd094575f14a5305df4d

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

[.contract-item]
<<<<<<< HEAD
=======
[[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.

[.contract-item]
>>>>>>> 2ac98beefbed0770d4dddd094575f14a5305df4d
[[Ownable-_transfer_ownership]]
==== `[.contract-item-name]#++_transfer_ownership++#++(ref self: ContractState, new_owner: ContractAddress)++` [.item-kind]#internal#

Expand All @@ -125,15 +109,6 @@ Internal function without access restriction.

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

<<<<<<< HEAD
[.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.

=======
>>>>>>> 2ac98beefbed0770d4dddd094575f14a5305df4d
[#Ownable-Events]
==== Events

Expand Down
85 changes: 85 additions & 0 deletions docs/modules/ROOT/pages/api/upgrades.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
:github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]
:class_hash: https://docs.starknet.io/documentation/architecture_and_concepts/Smart_Contracts/class-hash/[class hash]

= Upgrades

Reference of interfaces and utilities related to upgradeability.

== Core

[.contract]
[[IUpgradeable]]
=== `++IUpgradeable++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-0.7.0/src/upgrades/interface.cairo#L3[{github-icon},role=heading-link]

:Upgraded: xref:Upgradeable-Upgraded[Upgraded]

```javascript
use openzeppelin::upgrades::interface::IUpgradeable;
```

Interface of an upgradeable contract.

[.contract-index]
.Functions
--
* xref:#IUpgradeable-upgrade[`++upgrade(new_class_hash)++`]
--

[#IUpgradeable-Functions]
==== Functions

[.contract-item]
[[IUpgradeable-upgrade]]
==== `[.contract-item-name]#++upgrade++#++(new_class_hash: ClassHash)++` [.item-kind]#external#

Upgrades the contract code by updating its {class_hash}.

NOTE: This function is usually protected by an xref:access.adoc[Access Control] mechanism.

[.contract]
[[Upgradeable]]
=== `++Upgradeable++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-0.7.0/src/upgrades/upgradeable.cairo[{github-icon},role=heading-link]

```javascript
use openzeppelin::upgrades::upgradeable::Upgradeable;
```

Upgradeable contract module.

[.contract-index]
.Internal Functions
--
.InternalImpl

* xref:#Upgradeable-_upgrade[`++_upgrade(self, new_class_hash)++`]
--

[.contract-index]
.Events
--
* xref:#Upgradeable-Upgraded[`++Upgraded(class_hash)++`]
--

[#Upgradeable-Internal-Functions]
==== Internal Functions

[.contract-item]
[[Upgradeable-_upgrade]]
==== `[.contract-item-name]#++_upgrade++#++(ref self: ContractState, new_class_hash: ClassHash)++` [.item-kind]#internal#

Upgrades the contract by updating the contract {class_hash}.

Requirements:

- `new_class_hash` must be different from zero.

Emits an {Upgraded} event.

[#Upgradeable-Events]
==== Events

[.contract-item]
[[Upgradeable-Upgraded]]
==== `[.contract-item-name]#++Upgraded++#++(class_hash: ClassHash)++` [.item-kind]#event#

Emitted when the {class_hash} is upgraded.
Loading

0 comments on commit fe695e4

Please sign in to comment.