Based on this example: https://docs.rs/ink/latest/ink/struct.EnvAccess.html#method.instantiate_contract
Im doing something similar:
#[ink(message)]
pub fn new_multisig(&mut self, threshold: u8, owners_list: Vec<AccountId>, salt: Vec<u8>) {
let multisig = build_create::<MultiSigRef>()
.code_hash(self.multisig_codehash)
.gas_limit(0)
.endowment(0)
.exec_input(
ExecutionInput::new(Selector::new(ink::selector_bytes!("new")))
.push_arg(threshold)
.push_arg(owners_list),
)
.salt_bytes(salt)
.returns::<MultiSigRef>()
.instantiate();
self.env().emit_event(NewMultisig {
multisig_address: multisig, //Here i need to get the address of the new contract
threshold: threshold,
owners_list: owners_list,
});
}
But i need to obtain the address of the instantiated contract. How can i do it?