Can a resource account create and use another resource account? #98
-
Asked by
Keywords: resource account |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Yes, a resource account can be used to create another resource account. If you publish a module under a resource account ( Essentially, |
Beta Was this translation helpful? Give feedback.
Yes, a resource account can be used to create another resource account.
If you publish a module under a resource account (
create_resource_account_and_publish(&signer, SEED)
), and in that module'sinit_module
you callcreate_resource_account(&signer, SEED)
, there is no logic that verifies that theorigin
signer reference is another resource account. You can see this here.Essentially,
create_resource_account(&signer, SEED)
will create a new resource account, and the original resource account will be the owner. Thesigner_cap
will be stored in the original resource account'sContainer
resource. You can see that logic here.