In the example the returned type is a reference to a contract which implements the FromAccountId
trait. I would like to just have the contract address (AccountId
) stored so that the frontend can create instances of the contract. Is there a way to do this? thank you!
2 Answers
The returned reference also implements ToAccountId
. So by calling to_account_id()
on the returned type you should be able to get the AccountId
.
After a look into the rust doc, it is possible to use a lower level call to do this.
https://docs.rs/ink_lang/latest/ink_lang/struct.EnvAccess.html#method.instantiate_contract