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

  1. Make sure that there are no collisions, different inputs never lead to the same output.
  2. Make sure that the same inputs lead to the same output.

Required Methods§

source

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.

Implementors§