Trait pallet_contracts::AddressGenerator
source · pub trait AddressGenerator<T: Config> {
// Required method
fn contract_address(
deploying_address: &T::AccountId,
code_hash: &<T as Config>::Hash,
input_data: &[u8],
salt: &[u8],
) -> T::AccountId;
}
Expand description
Provides the contract address generation method.
See DefaultAddressGenerator
for the default implementation.
§Note for implementors
- Make sure that there are no collisions, different inputs never lead to the same output.
- Make sure that the same inputs lead to the same output.
Required Methods§
sourcefn contract_address(
deploying_address: &T::AccountId,
code_hash: &<T as Config>::Hash,
input_data: &[u8],
salt: &[u8],
) -> T::AccountId
fn contract_address( deploying_address: &T::AccountId, code_hash: &<T as Config>::Hash, input_data: &[u8], salt: &[u8], ) -> T::AccountId
The address of a contract based on the given instantiate parameters.
Changing the formular for an already deployed chain is fine as long as no collisions with the old formular. Changes only affect existing contracts.
Object Safety§
This trait is not object safe.