BitShares-Core  4.0.0
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:
graphene::db::abstract_object< account_object > graphene::db::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 Member Functions inherited from graphene::db::abstract_object< account_object >
virtual unique_ptr< objectclone () const
 these methods are implemented for derived classes by inheriting abstract_object<DerivedClass> More...
 
virtual void move_from (object &obj)
 
virtual variant to_variant () const
 
virtual vector< char > pack () const
 
- Public Member Functions inherited from graphene::db::object
 object ()
 
virtual ~object ()
 

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
 
uint16_t num_committee_voted
 Pre-calculated for better performance on chain maintenance. More...
 
account_statistics_id_type statistics
 
flat_set< account_id_type > whitelisting_accounts
 
flat_set< account_id_type > blacklisting_accounts
 
optional< vesting_balance_id_type > cashback_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_type > whitelisted_accounts
 
set< account_id_type > blacklisted_accounts
 
- Public Attributes inherited from graphene::db::object
object_id_type id
 

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
 
- Static Public Attributes inherited from graphene::db::object
static const uint8_t space_id = 0
 
static const uint8_t type_id = 0
 

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 170 of file account_object.hpp.

Member Typedef Documentation

Definition at line 215 of file account_object.hpp.

Member Function Documentation

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

Definition at line 286 of file account_object.hpp.

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

Definition at line 314 of file account_object.hpp.

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

Definition at line 279 of file account_object.hpp.

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 304 of file account_object.hpp.

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 298 of file account_object.hpp.

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

Definition at line 293 of file account_object.hpp.

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 309 of file account_object.hpp.

Member Data Documentation

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 213 of file account_object.hpp.

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

Definition at line 262 of file account_object.hpp.

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 277 of file account_object.hpp.

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

Definition at line 244 of file account_object.hpp.

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 254 of file account_object.hpp.

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

Vesting balance which receives cashback_reward deposits.

Definition at line 259 of file account_object.hpp.

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 191 of file account_object.hpp.

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

Percentage of fee which should go to lifetime referrer.

Definition at line 196 of file account_object.hpp.

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 184 of file account_object.hpp.

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 202 of file account_object.hpp.

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 194 of file account_object.hpp.

uint16_t graphene::chain::account_object::num_committee_voted

Pre-calculated for better performance on chain maintenance.

Definition at line 219 of file account_object.hpp.

account_options graphene::chain::account_object::options

Definition at line 216 of file account_object.hpp.

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 210 of file account_object.hpp.

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

Definition at line 261 of file account_object.hpp.

account_id_type graphene::chain::account_object::referrer

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

Definition at line 189 of file account_object.hpp.

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 199 of file account_object.hpp.

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 187 of file account_object.hpp.

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

Definition at line 173 of file account_object.hpp.

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 223 of file account_object.hpp.

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

Definition at line 270 of file account_object.hpp.

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 268 of file account_object.hpp.

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

Definition at line 269 of file account_object.hpp.

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

Definition at line 174 of file account_object.hpp.

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 243 of file account_object.hpp.

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 231 of file account_object.hpp.


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