pub fn initialize_contract<Contract, F, R>(
) -> <R as InitializerReturnType<Contract>>::Wrapped where
Contract: ContractRootKey + SpreadAllocate,
F: FnOnce(&mut Contract) -> R,
Initializes the ink! contract using the given initialization routine.
- This uses
SpreadAllocatetrait in order to default initialize the ink! smart contract before calling the initialization routine.
- This either returns
Result<Contract, E>depending on the return type
Rof the initializer closure
Contractis returned and if
Ris any type of
Result<Contract, E>is returned. Other return types for
Fthan the ones listed above are not allowed.