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 stringSTARKNET_CONTRACT_ADDRESS
. -
deployer_address
- The deployer address, unlessdeploy_from_zero
istrue
, in which case it is0
. -
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 It also thwarts replay attacks by influencing the transaction hash with a unique sender address. |
You can find more detail of the address computation in the Cairo code repository.