Closed jolestar closed 1 week ago
Because an Account is an Object, and the address is the ObjectID of Object<Account>, if we allow creating an account from an arbitrary address, someone may take the ObjectID before an Object is created(such as the named object or custom id object).
Object<Account>
https://github.com/rooch-network/rooch/blob/5a26585c604fc2752aca385a268572140e046053/frameworks/rooch-framework/sources/account.move#L23-L37
https://github.com/rooch-network/rooch/blob/5a26585c604fc2752aca385a268572140e046053/frameworks/rooch-framework/sources/transfer.move#L16-L27
If so, how to initialize a new account?
When the user sends the first transaction.
Motivation
Because an Account is an Object, and the address is the ObjectID of
Object<Account>
, if we allow creating an account from an arbitrary address, someone may take the ObjectID before an Object is created(such as the named object or custom id object).Solution
https://github.com/rooch-network/rooch/blob/5a26585c604fc2752aca385a268572140e046053/frameworks/rooch-framework/sources/account.move#L23-L37
https://github.com/rooch-network/rooch/blob/5a26585c604fc2752aca385a268572140e046053/frameworks/rooch-framework/sources/transfer.move#L16-L27