Based on this example

I'm doing something similar:

        pub fn new_multisig(&mut self, threshold: u8, owners_list: Vec<AccountId>, salt: Vec<u8>) {
            let multisig = build_create::<MultiSigRef>()

            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?

1 Answer 1


You can use to_account_id method to obtain address of instantiated smart contract.

use ink::ToAccountId;

let contract_address = multisig.to_account_id();
  • Hey! That worked, but i also needed to import the trait: use ink::ToAccountId;
    – Luca Auet
    Commented Aug 1, 2023 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.