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:

  1. balance the account's balance in L1x tokens

  2. nonce

  3. account_type the account type. Can be User or System

Account type

There are two types for an account: System and User:

  1. User type account represents a user's account

  2. System 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:

  1. Stake L1X tokens. When User stakes L1X tokens a new system account is created.

  2. 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.

  3. 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