Contract address

The contract address is a unique identifier of the contract on Starknet. It is a chain hash of the following information:

  • prefix - The ASCII encoding of the constant string STARKNET_CONTRACT_ADDRESS.

  • deployer_address - The deployer address, unless deploy_from_zero is true, in which case it is 0.

  • salt - The salt passed by the contract calling the syscall, provided by the transaction sender.

  • class_hash - See the class hash documentation.

  • constructor_calldata_hash - Array hash of the inputs to the constructor.

The address is computed as follows:

contract_address = pedersen(

A random salt ensures unique addresses for smart contract deployments, preventing conflicts when deploying identical contract classes.

It also thwarts replay attacks by influencing the transaction hash with a unique sender address.

Additional resources