forked from OpenZeppelin/cairo-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add headers and contract deployment example * start precomputing section * move udc helpers to utils * fix formatting * start changelog entry * add changelog entry * add udc and udc api in nav * move udc utils to udc module * update udc utils import * update udc doc * update utils * add udc api doc * fix formatting * Apply suggestions from code review Co-authored-by: Eric Nordelo <[email protected]> * Apply suggestions from code review Co-authored-by: Eric Nordelo <[email protected]> * remove duplicate link * use pedersen trait in compute fn * update util func names * fix formatting * add salt modification to deploy_contract description * add declare tx link * add udc to sidebar-collapse * remove first iteration NOTE * change function order * add interfaces mod * simplify import using interfaces mod * fix formatting * update comments * update interface import * add link to event * fix precomputing section * update universal_deployer api section in utils * fix deploy_syscall link * fix use statement * change util mod to deployments * change mod name to deployments, update links * fix formatting * add comment * add new udc contract address * Apply suggestions from code review Co-authored-by: Eric Nordelo <[email protected]> * Apply suggestions from code review Co-authored-by: Eric Nordelo <[email protected]> * fix fn * consolidate calculate udc fns, add DeployerInfo struct * update udc docs * move udc doc to modules * link udc util * fix calculate util name * update calculate util fn names * remove unused attr * update udc preset link --------- Co-authored-by: Eric Nordelo <[email protected]>
- Loading branch information
1 parent
cbd76fc
commit afd683f
Showing
15 changed files
with
365 additions
and
248 deletions.
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
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,87 @@ | ||
:github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>] | ||
|
||
= Universal Deployer | ||
|
||
Reference of the Universal Deployer Contract (UDC) interface and preset. | ||
|
||
== 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::interfaces::IUniversalDeployer; | ||
``` | ||
|
||
[.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`, `salt` is hashed with the caller address and the modified salt is passed to the inner `deploy_syscall`. This type of deployment is {origin-dependent}. | ||
|
||
When `from_zero` is `true`, the deployment type is {origin-independent}. | ||
|
||
Emits an <<IUniversalDeployer-ContractDeployed,ContractDeployed>> event. |
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
Oops, something went wrong.