-
Notifications
You must be signed in to change notification settings - Fork 359
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
andrew-fleming
merged 54 commits into
OpenZeppelin:main
from
andrew-fleming:add-udc-docs
Apr 16, 2024
Merged
Add udc docs #954
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 eb0bc53
start precomputing section
andrew-fleming d47cbe6
move udc helpers to utils
andrew-fleming 2d5deaa
fix formatting
andrew-fleming 0729cd0
start changelog entry
andrew-fleming a3775ce
add changelog entry
andrew-fleming e4b5a38
add udc and udc api in nav
andrew-fleming 18439c0
move udc utils to udc module
andrew-fleming 6f3e52a
update udc utils import
andrew-fleming d7c5a16
update udc doc
andrew-fleming 0534dc6
update utils
andrew-fleming d824a88
add udc api doc
andrew-fleming 4c48c4c
fix formatting
andrew-fleming 14754b6
Apply suggestions from code review
andrew-fleming 81e115d
Apply suggestions from code review
andrew-fleming b431ad8
remove duplicate link
andrew-fleming 5d75699
use pedersen trait in compute fn
andrew-fleming 061d2c3
update util func names
andrew-fleming 595fcad
fix formatting
andrew-fleming f6a825b
add salt modification to deploy_contract description
andrew-fleming adc3d5e
fix conflicts
andrew-fleming 7810065
add declare tx link
andrew-fleming 7342378
add udc to sidebar-collapse
andrew-fleming 851d6c6
remove first iteration NOTE
andrew-fleming 40d1278
change function order
andrew-fleming 1548022
add interfaces mod
andrew-fleming 6b12a02
simplify import using interfaces mod
andrew-fleming 7052b4c
fix formatting
andrew-fleming 658d304
update comments
andrew-fleming 963d9ac
update interface import
andrew-fleming 888f489
add link to event
andrew-fleming d7c9425
fix precomputing section
andrew-fleming cb33f0b
update universal_deployer api section in utils
andrew-fleming 47a1974
fix deploy_syscall link
andrew-fleming d31e448
fix use statement
andrew-fleming 9b03f92
change util mod to deployments
andrew-fleming c831846
change mod name to deployments, update links
andrew-fleming 5d418c9
fix formatting
andrew-fleming 960ec0f
add comment
andrew-fleming 1cd8efc
add new udc contract address
andrew-fleming d56658f
Apply suggestions from code review
andrew-fleming 0f1ce9b
Apply suggestions from code review
andrew-fleming 323fd83
fix fn
andrew-fleming 73ecf30
consolidate calculate udc fns, add DeployerInfo struct
andrew-fleming 26e491f
update udc docs
andrew-fleming 762cab2
move udc doc to modules
andrew-fleming ec18f48
link udc util
andrew-fleming 379f961
fix calculate util name
andrew-fleming b5c485e
update calculate util fn names
andrew-fleming 2577610
fix conflicts
andrew-fleming ad4f5db
remove unused attr
andrew-fleming ad653a2
fix conflicts
andrew-fleming 9a9eac1
fix conflicts
andrew-fleming ff99cde
update udc preset link
andrew-fleming File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.