Account
Each account has an associated state where it stores its metadata.
Accounts' states can be read by anyone in the network, but only the account itself can change it.
An account can own several smart-contracts
Account's Metadata
The state keeps track of relevant metadata from the contract. Particularly, the state stores the following fields:
balance
the account's balance in L1x tokensnonce
account_type
the account type. Can beUser
orSystem
Account type
There are two types for an account: System
and User:
User
type account represents a user's accountSystem
account is a services account.
Account creation
Account creation depends on its type.
User
account can be created by transferring L1X tokens to a new account address.
System
account is created automatically when by the following actions:
Stake L1X tokens. When
User
stakes L1X tokens a new system account is created.Deploy Smart-contract. When a contract is deployed, a new system account is created. The
balance
of this account is zero. All tokens that are transferred to this account will be lost.Initialize Smart-Contract. When a smart contract is initialized, a new system account is created. The initial balance of this account is zero but this account can be deposited. The account holds smart-contract state. Same smart contract can be initialized many times and a new system account is created for each initialization.
Last updated