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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.