2

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 2

4

The returned reference also implements ToAccountId. So by calling to_account_id() on the returned type you should be able to get the AccountId.

2

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

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.