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

One of the following:

  • When the contract is deployed via a DEPLOY_ACCOUNT transaction: 0

  • When the contract is deployed via a deploy system call from another contract, the value of the deploy_from_zero parameter determines this value.

    For information on the deploy_from_zero parameter, see the deploy system call

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(
    “STARKNET_CONTRACT_ADDRESS”,
    deployer_address,
    salt,
    class_hash,
    constructor_calldata_hash)

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