rooch-network / rooch

VApp Container with Move Language
https://rooch.network
Apache License 2.0
128 stars 54 forks source link

[move stdlib] Disable create account from arbitrary address #1624

Closed jolestar closed 1 week ago

jolestar commented 3 weeks ago

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

  1. Remove the entry function:

https://github.com/rooch-network/rooch/blob/5a26585c604fc2752aca385a268572140e046053/frameworks/rooch-framework/sources/account.move#L23-L37

  1. Remove auto-create account when transfer coin and object

https://github.com/rooch-network/rooch/blob/5a26585c604fc2752aca385a268572140e046053/frameworks/rooch-framework/sources/transfer.move#L16-L27

pause125 commented 2 weeks ago

If so, how to initialize a new account?

jolestar commented 2 weeks ago

If so, how to initialize a new account?

When the user sends the first transaction.