Bitshares-Core  2.0.181105
BitShares blockchain implementation and command-line interface software
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
graphene::chain::account_object Class Reference

This class represents an account on the object graphAccounts are the primary unit of authority on the graphene system. Users must have an account in order to use assets, trade in the markets, vote for committee_members, etc. More...

#include <account_object.hpp>

Inheritance diagram for graphene::chain::account_object:

Public Types

typedef account_options options_type
 

Public Member Functions

bool has_special_authority () const
 
template<typename DB >
const vesting_balance_objectcashback_balance (const DB &db) const
 
bool is_lifetime_member () const
 
bool is_basic_account (time_point_sec now) const
 
bool is_annual_member (time_point_sec now) const
 
bool is_member (time_point_sec now) const
 
account_id_type get_id () const
 

Public Attributes

time_point_sec membership_expiration_date
 
account_id_type registrar
 The account that paid the fee to register this account. Receives a percentage of referral rewards. More...
 
account_id_type referrer
 The account credited as referring this account. Receives a percentage of referral rewards. More...
 
account_id_type lifetime_referrer
 The lifetime member at the top of the referral tree. Receives a percentage of referral rewards. More...
 
uint16_t network_fee_percentage = GRAPHENE_DEFAULT_NETWORK_PERCENT_OF_FEE
 Percentage of fee which should go to network. More...
 
uint16_t lifetime_referrer_fee_percentage = 0
 Percentage of fee which should go to lifetime referrer. More...
 
uint16_t referrer_rewards_percentage = 0
 
string name
 The account's name. This name must be unique among all account names on the graph. May not be empty. More...
 
authority owner
 
authority active
 
account_options options
 
account_statistics_id_type statistics
 
flat_set< account_id_typewhitelisting_accounts
 
flat_set< account_id_typeblacklisting_accounts
 
optional< vesting_balance_id_typecashback_vb
 
special_authority owner_special_authority = no_special_authority()
 
special_authority active_special_authority = no_special_authority()
 
uint8_t top_n_control_flags = 0
 
optional< flat_set< asset_id_type > > allowed_assets
 
set< account_id_typewhitelisted_accounts
 
set< account_id_typeblacklisted_accounts
 

Static Public Attributes

static const uint8_t space_id = protocol_ids
 
static const uint8_t type_id = account_object_type
 
static const uint8_t top_n_control_owner = 1
 
static const uint8_t top_n_control_active = 2
 

Detailed Description

This class represents an account on the object graph

Accounts are the primary unit of authority on the graphene system. Users must have an account in order to use assets, trade in the markets, vote for committee_members, etc.

Definition at line 145 of file account_object.hpp.

Member Typedef Documentation

◆ options_type

Definition at line 190 of file account_object.hpp.

Member Function Documentation

◆ cashback_balance()

template<typename DB >
const vesting_balance_object& graphene::chain::account_object::cashback_balance ( const DB &  db) const
inline

Definition at line 258 of file account_object.hpp.

◆ get_id()

account_id_type graphene::chain::account_object::get_id ( ) const
inline

Definition at line 286 of file account_object.hpp.

◆ has_special_authority()

bool graphene::chain::account_object::has_special_authority ( ) const
inline

Definition at line 251 of file account_object.hpp.

◆ is_annual_member()

bool graphene::chain::account_object::is_annual_member ( time_point_sec  now) const
inline
Returns
true if the account is an unexpired annual member; false otherwise.
Note
This method will return false for lifetime members.

Definition at line 276 of file account_object.hpp.

◆ is_basic_account()

bool graphene::chain::account_object::is_basic_account ( time_point_sec  now) const
inline
Returns
true if this is a basic account; false otherwise.

Definition at line 270 of file account_object.hpp.

◆ is_lifetime_member()

bool graphene::chain::account_object::is_lifetime_member ( ) const
inline
Returns
true if this is a lifetime member account; false otherwise.

Definition at line 265 of file account_object.hpp.

◆ is_member()

bool graphene::chain::account_object::is_member ( time_point_sec  now) const
inline
Returns
true if the account is an annual or lifetime member; false otherwise.

Definition at line 281 of file account_object.hpp.

Member Data Documentation

◆ active

authority graphene::chain::account_object::active

The owner authority contains the hot keys of the account. This authority has control over nearly all operations the account may perform.

Definition at line 188 of file account_object.hpp.

◆ active_special_authority

special_authority graphene::chain::account_object::active_special_authority = no_special_authority()

Definition at line 234 of file account_object.hpp.

◆ allowed_assets

optional< flat_set<asset_id_type> > graphene::chain::account_object::allowed_assets

This is a set of assets which the account is allowed to have. This is utilized to restrict buyback accounts to the assets that trade in their markets. In the future we may expand this to allow accounts to e.g. voluntarily restrict incoming transfers.

Definition at line 249 of file account_object.hpp.

◆ blacklisted_accounts

set<account_id_type> graphene::chain::account_object::blacklisted_accounts

Definition at line 216 of file account_object.hpp.

◆ blacklisting_accounts

flat_set<account_id_type> graphene::chain::account_object::blacklisting_accounts

This is a set of all accounts which have 'blacklisted' this account. Blacklisting is only used in core validation for the purpose of forbidding accounts from holding and transacting in whitelisted assets. This account cannot update this set, and it will be preserved even if the account is transferred. Other accounts may add or remove their IDs from this set.

Definition at line 226 of file account_object.hpp.

◆ cashback_vb

optional<vesting_balance_id_type> graphene::chain::account_object::cashback_vb

Vesting balance which receives cashback_reward deposits.

Definition at line 231 of file account_object.hpp.

◆ lifetime_referrer

account_id_type graphene::chain::account_object::lifetime_referrer

The lifetime member at the top of the referral tree. Receives a percentage of referral rewards.

Definition at line 166 of file account_object.hpp.

◆ lifetime_referrer_fee_percentage

uint16_t graphene::chain::account_object::lifetime_referrer_fee_percentage = 0

Percentage of fee which should go to lifetime referrer.

Definition at line 171 of file account_object.hpp.

◆ membership_expiration_date

time_point_sec graphene::chain::account_object::membership_expiration_date

The time at which this account's membership expires. If set to any time in the past, the account is a basic account. If set to time_point_sec::maximum(), the account is a lifetime member. If set to any time not in the past less than time_point_sec::maximum(), the account is an annual member.

See is_lifetime_member, is_basic_account, is_annual_member, and is_member

Definition at line 159 of file account_object.hpp.

◆ name

string graphene::chain::account_object::name

The account's name. This name must be unique among all account names on the graph. May not be empty.

Definition at line 177 of file account_object.hpp.

◆ network_fee_percentage

uint16_t graphene::chain::account_object::network_fee_percentage = GRAPHENE_DEFAULT_NETWORK_PERCENT_OF_FEE

Percentage of fee which should go to network.

Definition at line 169 of file account_object.hpp.

◆ options

account_options graphene::chain::account_object::options

Definition at line 191 of file account_object.hpp.

◆ owner

authority graphene::chain::account_object::owner

The owner authority represents absolute control over the account. Usually the keys in this authority will be kept in cold storage, as they should not be needed very often and compromise of these keys constitutes complete and irrevocable loss of the account. Generally the only time the owner authority is required is to update the active authority.

Definition at line 185 of file account_object.hpp.

◆ owner_special_authority

special_authority graphene::chain::account_object::owner_special_authority = no_special_authority()

Definition at line 233 of file account_object.hpp.

◆ referrer

account_id_type graphene::chain::account_object::referrer

The account credited as referring this account. Receives a percentage of referral rewards.

Definition at line 164 of file account_object.hpp.

◆ referrer_rewards_percentage

uint16_t graphene::chain::account_object::referrer_rewards_percentage = 0

Percentage of referral rewards (leftover fee after paying network and lifetime referrer) which should go to referrer. The remainder of referral rewards goes to the registrar.

Definition at line 174 of file account_object.hpp.

◆ registrar

account_id_type graphene::chain::account_object::registrar

The account that paid the fee to register this account. Receives a percentage of referral rewards.

Definition at line 162 of file account_object.hpp.

◆ space_id

const uint8_t graphene::chain::account_object::space_id = protocol_ids
static

Definition at line 148 of file account_object.hpp.

◆ statistics

account_statistics_id_type graphene::chain::account_object::statistics

The reference implementation records the account's statistics in a separate object. This field contains the ID of that object.

Definition at line 195 of file account_object.hpp.

◆ top_n_control_active

const uint8_t graphene::chain::account_object::top_n_control_active = 2
static

Definition at line 242 of file account_object.hpp.

◆ top_n_control_flags

uint8_t graphene::chain::account_object::top_n_control_flags = 0

This flag is set when the top_n logic sets both authorities, and gets reset when authority or special_authority is set.

Definition at line 240 of file account_object.hpp.

◆ top_n_control_owner

const uint8_t graphene::chain::account_object::top_n_control_owner = 1
static

Definition at line 241 of file account_object.hpp.

◆ type_id

const uint8_t graphene::chain::account_object::type_id = account_object_type
static

Definition at line 149 of file account_object.hpp.

◆ whitelisted_accounts

set<account_id_type> graphene::chain::account_object::whitelisted_accounts

Optionally track all of the accounts this account has whitelisted or blacklisted, these should be made Immutable so that when the account object is cloned no deep copy is required. This state is tracked for GUI display purposes.

TODO: move white list tracking to its own multi-index container rather than having 4 fields on an account. This will scale better because under the current design if you whitelist 2000 accounts, then every time someone fetches this account object they will get the full list of 2000 accounts.

Definition at line 215 of file account_object.hpp.

◆ whitelisting_accounts

flat_set<account_id_type> graphene::chain::account_object::whitelisting_accounts

This is a set of all accounts which have 'whitelisted' this account. Whitelisting is only used in core validation for the purpose of authorizing accounts to hold and transact in whitelisted assets. This account cannot update this set, except by transferring ownership of the account, which will clear it. Other accounts may add or remove their IDs from this set.

Definition at line 203 of file account_object.hpp.


The documentation for this class was generated from the following files: