You are not reading the current version of this documentation. 1.0.0 is the current version.

Universal Deployer

Reference of the Universal Deployer Contract (UDC) interface and preset.

Core

IUniversalDeployer

use openzeppelin_utils::interfaces::IUniversalDeployer;

Functions

deploy_contract(class_hash: ClassHash, salt: felt252, from_zero: bool, calldata: Span<felt252>) → ContractAddress external

Deploys a contract through the Universal Deployer Contract.

Events

ContractDeployed(address: ContractAddress, deployer: ContractAddress, from_zero: bool, class_hash: ClassHash, calldata: Span<felt252>, salt: felt252) event

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

Presets

UniversalDeployer

use openzeppelin_presets::UniversalDeployer;

The standard Universal Deployer Contract.

0x050e13234a6abdb992c9e07aab8b88c7067b8acb243d2e2d08eeb6b8ccd26c7c

deploy_contract(ref self: ContractState, address: ContractAddress, deployer: ContractAddress, from_zero: bool, class_hash: ClassHash, calldata: Span<felt252>, salt: felt252) -> ContractAddress 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 ContractDeployed event.