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

Add udc docs #954

Merged
merged 54 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
06a2091
add headers and contract deployment example
andrew-fleming Mar 25, 2024
eb0bc53
start precomputing section
andrew-fleming Mar 26, 2024
d47cbe6
move udc helpers to utils
andrew-fleming Mar 26, 2024
2d5deaa
fix formatting
andrew-fleming Mar 26, 2024
0729cd0
start changelog entry
andrew-fleming Mar 26, 2024
a3775ce
add changelog entry
andrew-fleming Mar 26, 2024
e4b5a38
add udc and udc api in nav
andrew-fleming Mar 28, 2024
18439c0
move udc utils to udc module
andrew-fleming Mar 28, 2024
6f3e52a
update udc utils import
andrew-fleming Mar 28, 2024
d7c5a16
update udc doc
andrew-fleming Mar 28, 2024
0534dc6
update utils
andrew-fleming Mar 28, 2024
d824a88
add udc api doc
andrew-fleming Mar 28, 2024
4c48c4c
fix formatting
andrew-fleming Mar 28, 2024
14754b6
Apply suggestions from code review
andrew-fleming Mar 28, 2024
81e115d
Apply suggestions from code review
andrew-fleming Mar 28, 2024
b431ad8
remove duplicate link
andrew-fleming Mar 28, 2024
5d75699
use pedersen trait in compute fn
andrew-fleming Mar 28, 2024
061d2c3
update util func names
andrew-fleming Mar 29, 2024
595fcad
fix formatting
andrew-fleming Mar 29, 2024
f6a825b
add salt modification to deploy_contract description
andrew-fleming Mar 29, 2024
adc3d5e
fix conflicts
andrew-fleming Mar 29, 2024
7810065
add declare tx link
andrew-fleming Mar 29, 2024
7342378
add udc to sidebar-collapse
andrew-fleming Mar 29, 2024
851d6c6
remove first iteration NOTE
andrew-fleming Mar 29, 2024
40d1278
change function order
andrew-fleming Mar 30, 2024
1548022
add interfaces mod
andrew-fleming Mar 30, 2024
6b12a02
simplify import using interfaces mod
andrew-fleming Mar 30, 2024
7052b4c
fix formatting
andrew-fleming Mar 30, 2024
658d304
update comments
andrew-fleming Mar 31, 2024
963d9ac
update interface import
andrew-fleming Mar 31, 2024
888f489
add link to event
andrew-fleming Mar 31, 2024
d7c9425
fix precomputing section
andrew-fleming Mar 31, 2024
cb33f0b
update universal_deployer api section in utils
andrew-fleming Mar 31, 2024
47a1974
fix deploy_syscall link
andrew-fleming Mar 31, 2024
d31e448
fix use statement
andrew-fleming Mar 31, 2024
9b03f92
change util mod to deployments
andrew-fleming Mar 31, 2024
c831846
change mod name to deployments, update links
andrew-fleming Mar 31, 2024
5d418c9
fix formatting
andrew-fleming Mar 31, 2024
960ec0f
add comment
andrew-fleming Apr 1, 2024
1cd8efc
add new udc contract address
andrew-fleming Apr 3, 2024
d56658f
Apply suggestions from code review
andrew-fleming Apr 9, 2024
0f1ce9b
Apply suggestions from code review
andrew-fleming Apr 9, 2024
323fd83
fix fn
andrew-fleming Apr 9, 2024
73ecf30
consolidate calculate udc fns, add DeployerInfo struct
andrew-fleming Apr 9, 2024
26e491f
update udc docs
andrew-fleming Apr 9, 2024
762cab2
move udc doc to modules
andrew-fleming Apr 9, 2024
ec18f48
link udc util
andrew-fleming Apr 11, 2024
379f961
fix calculate util name
andrew-fleming Apr 11, 2024
b5c485e
update calculate util fn names
andrew-fleming Apr 11, 2024
2577610
fix conflicts
andrew-fleming Apr 11, 2024
ad4f5db
remove unused attr
andrew-fleming Apr 15, 2024
ad653a2
fix conflicts
andrew-fleming Apr 15, 2024
9a9eac1
fix conflicts
andrew-fleming Apr 16, 2024
ff99cde
update udc preset link
andrew-fleming Apr 16, 2024
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- UDC preset contract (#919)
- ERC1155Component and ERC1155ReceiverComponent mixins (#941)
- ERC721ReceiverComponent documentation (#945)
- UDC docs (#954)
- Util functions to precompute addresses (#954)

### Changed

Expand Down
3 changes: 2 additions & 1 deletion docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
** xref:presets.adoc[Presets]
** xref:interfaces.adoc[Interfaces and Dispatchers]
** xref:guides/deployment.adoc[Counterfactual Deployments]
// ** xref:udc.adoc[Universal Deployer Contract]

* Modules

Expand Down Expand Up @@ -37,6 +36,8 @@
*** xref:/api/upgrades.adoc[API Reference]

** xref:utilities.adoc[Utilities]
*** xref:udc.adoc[Universal Deployer Contract]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this should not be under utilities, since we have a preset, I think this should be under the modules section directly, even if the interface is in the utilities.

**** xref:/api/udc.adoc[API Reference]

* xref:backwards-compatibility.adoc[Backwards Compatibility]
* xref:contracts::index.adoc[Contracts for Solidity]
86 changes: 86 additions & 0 deletions docs/modules/ROOT/pages/api/udc.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
:github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]

= Universal Deployer

Reference of the Universal Deployer Contract (UDC) interface and preset contract.
andrew-fleming marked this conversation as resolved.
Show resolved Hide resolved

== Core

[.contract]
[[IUniversalDeployer]]
=== `++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]

```javascript
use openzeppelin::utils::universal_deployer::interface::IUniversalDeployer;
ericnordelo marked this conversation as resolved.
Show resolved Hide resolved
```

[.contract-index]
.Functions
--
* xref:#IUniversalDeployer-deploy_contract[`++deploy_contract(class_hash, salt, from_zero, calldata)++`]
--

[.contract-index]
.Events
--
* xref:#IUniversalDeployer-ContractDeployed[`++ContractDeployed(address, deployer, from_zero, class_hash, calldata, salt)++`]
--

[#IUniversalDeployer-Functions]
==== Functions

[.contract-item]
[[IUniversalDeployer-deploy_contract]]
==== `[.contract-item-name]#++deploy_contract++#++(class_hash: ClassHash, salt: felt252, from_zero: bool, calldata: Span<felt252>) → ContractAddress++` [.item-kind]#external#

Deploys a contract through the Universal Deployer Contract.

[#IUniversalDeployer-Events]
==== Events

[.contract-item]
[[IUniversalDeployer-ContractDeployed]]
==== `[.contract-item-name]#++ContractDeployed++#++(address: ContractAddress, deployer: ContractAddress, from_zero: bool, class_hash: ClassHash, calldata: Span<felt252>, salt: felt252)++` [.item-kind]#event#

Emitted when `deployer` deploys a contract through the Universal Deployer Contract.

== Presets

:origin-dependent: xref:/udc.adoc#origin_dependent[origin-dependent]
:origin-independent: xref:/udc.adoc#origin_independent[origin-independent]

[.contract]
[[UniversalDeployer]]
=== `++UniversalDeployer++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.10.0/src/presets/universal_deployer.cairo[{github-icon},role=heading-link]

```javascript
use openzeppelin::presets::UniversalDeployer;
```

The standard Universal Deployer Contract.

include::../utils/_class_hashes.adoc[]

[.contract-index]
.{presets-page}
--
{UniversalDeployer-class-hash}
--

[.contract-index]
.Embedded Implementations
--
.UniversalDeployerImpl
* xref:#UniversalDeployer-deploy_contract[`++deploy_contract(self, address, deployer, from_zero, class_hash, calldata, salt)++`]
--

[.contract-item]
[[UniversalDeployer-deploy_contract]]
==== `[.contract-item-name]#++deploy_contract++#++(ref self: ContractState, address: ContractAddress, deployer: ContractAddress, from_zero: bool, class_hash: ClassHash, calldata: Span<felt252>, salt: felt252) -> ContractAddress++` [.item-kind]#external#

Deploys a contract through the Universal Deployer Contract.

When `from_zero` is `false`, the deployment type is {origin-dependent}.
ericnordelo marked this conversation as resolved.
Show resolved Hide resolved
When `from_zero` is `true`, the deployment type is {origin-independent}.

Emits an <<IUniversalDeployer-ContractDeployed,ContractDeployed>> event.
Loading
Loading