Universal Deployer

Transaction Types

There are only 3 types of txns on Starknet:

  • deploy_account - deploys a user account

  • declare - registers the sierra code of a smart contract on-chain

  • invoke - executes an “external” smart contract function

Declaring vs. Deploying

  • declaring registers a “blueprint” of a smart contract on-chain using its Sierra code

  • the blueprint is also known as the contract class, and is identified by its class hash

hash(
	contract_class_version, 
	external_entry_points,
	l1_handler_entry_points,
	constructor_entry_points, 
	abi_hash,
	sierra_programe_hash
) 
  • from the contract class, multiple contract instances can be created (deployed)

  • the class hash can also be used for libraries

Universal Deployer Contract (UDC)

  • smart contract that deployes other smart contracts using the deploy syscall

  • created by OZ in Cairo 0 and deployed to starknet

  • contains a deploy_contract function that takes in the class hash of a smart contract class previously declared, entropy for the deployed smart contract address, a boolean that declares if the instance is unique, and arguments for the deployed smart contract’s constructor.

  • the universal deployer is a public good in the starknet ecosystem

  • preventing address squatting - prevents scammer from claiming address on different starknet networks

Last updated