namespace chain


typedef multi_index_container<account_balance_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_non_unique<tag<by_maintenance_flag>, member<account_balance_object, bool, &account_balance_object::maintenance_flag>>, ordered_unique<tag<by_account_asset>, composite_key<account_balance_object, member<account_balance_object, account_id_type, &account_balance_object::owner>, member<account_balance_object, asset_id_type, &account_balance_object::asset_type>>>, ordered_unique<tag<by_asset_balance>, composite_key<account_balance_object, member<account_balance_object, asset_id_type, &account_balance_object::asset_type>, member<account_balance_object, share_type, &account_balance_object::balance>, member<account_balance_object, account_id_type, &account_balance_object::owner>>, composite_key_compare<std::less<asset_id_type>, std::greater<share_type>, std::less<account_id_type>>>>> account_balance_object_multi_index_type
typedef generic_index<account_balance_object, account_balance_object_multi_index_type> account_balance_index
typedef multi_index_container<account_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_name>, member<account_object, string, &account_object::name>>>> account_multi_index_type
typedef generic_index<account_object, account_multi_index_type> account_index
typedef multi_index_container<account_statistics_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_owner>, member<account_statistics_object, account_id_type, &account_statistics_object::owner>>, ordered_unique<tag<by_maintenance_seq>, composite_key<account_statistics_object, const_mem_fun<account_statistics_object, bool, &account_statistics_object::need_maintenance>, member<account_statistics_object, string, &account_statistics_object::name>>>>> account_stats_multi_index_type
typedef generic_index<account_statistics_object, account_stats_multi_index_type> account_stats_index
typedef multi_index_container<asset_bitasset_data_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_non_unique<tag<by_short_backing_asset>, bitasset_short_backing_asset_extractor>, ordered_unique<tag<by_feed_expiration>, composite_key<asset_bitasset_data_object, const_mem_fun<asset_bitasset_data_object, time_point_sec, &asset_bitasset_data_object::feed_expiration_time>, member<asset_bitasset_data_object, asset_id_type, &asset_bitasset_data_object::asset_id>>>, ordered_non_unique<tag<by_cer_update>, const_mem_fun<asset_bitasset_data_object, bool, &asset_bitasset_data_object::need_to_update_cer>>>> asset_bitasset_data_object_multi_index_type
typedef generic_index<asset_bitasset_data_object, asset_bitasset_data_object_multi_index_type> asset_bitasset_data_index
typedef multi_index_container<asset_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_symbol>, member<asset_object, string, &asset_object::symbol>>, ordered_non_unique<tag<by_issuer>, member<asset_object, account_id_type, &asset_object::issuer>>, ordered_unique<tag<by_type>, composite_key<asset_object, const_mem_fun<asset_object, bool, &asset_object::is_market_issued>, member<object, object_id_type, &object::id>>>>> asset_object_multi_index_type
typedef generic_index<asset_object, asset_object_multi_index_type> asset_index
using balance_multi_index_type = multi_index_container<balance_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_non_unique<tag<by_owner>, composite_key<balance_object, member<balance_object, address, &balance_object::owner>, const_mem_fun<balance_object, asset_id_type, &balance_object::asset_type>>>>>
using balance_index = generic_index<balance_object, balance_multi_index_type>
typedef multi_index_container<buyback_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_asset>, member<buyback_object, asset_id_type, &buyback_object::asset_to_buy>>>> buyback_multi_index_type
typedef generic_index<buyback_object, buyback_multi_index_type> buyback_index
using committee_member_multi_index_type = multi_index_container<committee_member_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_account>, member<committee_member_object, account_id_type, &committee_member_object::committee_member_account>>, ordered_unique<tag<by_vote_id>, member<committee_member_object, vote_id_type, &committee_member_object::vote_id>>>>
using committee_member_index = generic_index<committee_member_object, committee_member_multi_index_type>
typedef multi_index_container<blinded_balance_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_commitment>, member<blinded_balance_object, commitment_type, &blinded_balance_object::commitment>>>> blinded_balance_object_multi_index_type
typedef generic_index<blinded_balance_object, blinded_balance_object_multi_index_type> blinded_balance_index
typedef shared_ptr<fork_item> item_ptr
typedef multi_index_container<limit_order_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_expiration>, composite_key<limit_order_object, member<limit_order_object, time_point_sec, &limit_order_object::expiration>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_price>, composite_key<limit_order_object, member<limit_order_object, price, &limit_order_object::sell_price>, member<object, object_id_type, &object::id>>, composite_key_compare<std::greater<price>, std::less<object_id_type>>>, ordered_unique<tag<by_account>, composite_key<limit_order_object, member<limit_order_object, account_id_type, &limit_order_object::seller>, member<limit_order_object, price, &limit_order_object::sell_price>, member<object, object_id_type, &object::id>>, composite_key_compare<std::less<account_id_type>, std::greater<price>, std::less<object_id_type>>>>> limit_order_multi_index_type
typedef generic_index<limit_order_object, limit_order_multi_index_type> limit_order_index
typedef multi_index_container<call_order_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_price>, composite_key<call_order_object, member<call_order_object, price, &call_order_object::call_price>, member<object, object_id_type, &object::id>>, composite_key_compare<std::less<price>, std::less<object_id_type>>>, ordered_unique<tag<by_account>, composite_key<call_order_object, member<call_order_object, account_id_type, &call_order_object::borrower>, const_mem_fun<call_order_object, asset_id_type, &call_order_object::debt_type>>>, ordered_unique<tag<by_collateral>, composite_key<call_order_object, const_mem_fun<call_order_object, price, &call_order_object::collateralization>, member<object, object_id_type, &object::id>>>>> call_order_multi_index_type
typedef multi_index_container<force_settlement_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_account>, composite_key<force_settlement_object, member<force_settlement_object, account_id_type, &force_settlement_object::owner>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_expiration>, composite_key<force_settlement_object, const_mem_fun<force_settlement_object, asset_id_type, &force_settlement_object::settlement_asset_id>, member<force_settlement_object, time_point_sec, &force_settlement_object::settlement_date>, member<object, object_id_type, &object::id>>>>> force_settlement_object_multi_index_type
typedef multi_index_container<collateral_bid_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_account>, composite_key<collateral_bid_object, const_mem_fun<collateral_bid_object, asset_id_type, &collateral_bid_object::debt_type>, member<collateral_bid_object, account_id_type, &collateral_bid_object::bidder>>>, ordered_unique<tag<by_price>, composite_key<collateral_bid_object, const_mem_fun<collateral_bid_object, asset_id_type, &collateral_bid_object::debt_type>, member<collateral_bid_object, price, &collateral_bid_object::inv_swan_price>, member<object, object_id_type, &object::id>>, composite_key_compare<std::less<asset_id_type>, std::greater<price>, std::less<object_id_type>>>>> collateral_bid_object_multi_index_type
typedef generic_index<call_order_object, call_order_multi_index_type> call_order_index
typedef generic_index<force_settlement_object, force_settlement_object_multi_index_type> force_settlement_index
typedef generic_index<collateral_bid_object, collateral_bid_object_multi_index_type> collateral_bid_index
typedef multi_index_container<operation_history_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>>> operation_history_multi_index_type
typedef generic_index<operation_history_object, operation_history_multi_index_type> operation_history_index
typedef multi_index_container<account_transaction_history_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_seq>, composite_key<account_transaction_history_object, member<account_transaction_history_object, account_id_type, &account_transaction_history_object::account>, member<account_transaction_history_object, uint32_t, &account_transaction_history_object::sequence>>>, ordered_unique<tag<by_op>, composite_key<account_transaction_history_object, member<account_transaction_history_object, account_id_type, &account_transaction_history_object::account>, member<account_transaction_history_object, operation_history_id_type, &account_transaction_history_object::operation_id>>>, ordered_non_unique<tag<by_opid>, member<account_transaction_history_object, operation_history_id_type, &account_transaction_history_object::operation_id>>>> account_transaction_history_multi_index_type
typedef generic_index<account_transaction_history_object, account_transaction_history_multi_index_type> account_transaction_history_index
typedef boost::multi_index_container<proposal_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_expiration>, composite_key<proposal_object, member<proposal_object, time_point_sec, &proposal_object::expiration_time>, member<object, object_id_type, &object::id>>>>> proposal_multi_index_container
typedef generic_index<proposal_object, proposal_multi_index_container> proposal_index
typedef static_variant<account_name_eq_lit_predicate, asset_symbol_eq_lit_predicate, block_id_predicate> predicate

When defining predicates do not make the protocol dependent upon implementation details.

typedef fc::static_variant<void_result, object_id_type, asset> operation_result
typedef static_variant<void_t> future_extensions

For future expansion many structus include a single member of type extensions_type that can be changed when updating a protocol. You can always add new types to a static_variant without breaking backward compatibility.

typedef flat_set<future_extensions> extensions_type

A flat_set is used to make sure that only one extension of each type is added and that they are added in order.


static_variant compares only the type tag and not the content.

typedef static_variant parameter_extension
typedef transform_to_fee_parameters<operation>::type fee_parameters
typedef fee_schedule fee_schedule_type
typedef fc::static_variant<transfer_operation, limit_order_create_operation, limit_order_cancel_operation, call_order_update_operation, fill_order_operation, account_create_operation, account_update_operation, account_whitelist_operation, account_upgrade_operation, account_transfer_operation, asset_create_operation, asset_update_operation, asset_update_bitasset_operation, asset_update_feed_producers_operation, asset_issue_operation, asset_reserve_operation, asset_fund_fee_pool_operation, asset_settle_operation, asset_global_settle_operation, asset_publish_feed_operation, witness_create_operation, witness_update_operation, proposal_create_operation, proposal_update_operation, proposal_delete_operation, withdraw_permission_create_operation, withdraw_permission_update_operation, withdraw_permission_claim_operation, withdraw_permission_delete_operation, committee_member_create_operation, committee_member_update_operation, committee_member_update_global_parameters_operation, vesting_balance_create_operation, vesting_balance_withdraw_operation, worker_create_operation, custom_operation, assert_operation, balance_claim_operation, override_transfer_operation, transfer_to_blind_operation, blind_transfer_operation, transfer_from_blind_operation, asset_settle_cancel_operation, asset_claim_fees_operation, fba_distribute_operation, bid_collateral_operation, execute_bid_operation, asset_claim_pool_operation, asset_update_issuer_operation> operation

Defines the set of valid operations as a discriminated union type.

typedef static_variant<no_special_authority, top_holders_special_authority> special_authority
typedef fc::ecc::private_key private_key_type
typedef fc::sha256 chain_id_type
typedef boost::rational<int32_t> ratio_type
typedef object_id<protocol_ids, account_object_type, account_object> account_id_type
typedef object_id<protocol_ids, asset_object_type, asset_object> asset_id_type
typedef object_id<protocol_ids, force_settlement_object_type, force_settlement_object> force_settlement_id_type
typedef object_id<protocol_ids, committee_member_object_type, committee_member_object> committee_member_id_type
typedef object_id<protocol_ids, witness_object_type, witness_object> witness_id_type
typedef object_id<protocol_ids, limit_order_object_type, limit_order_object> limit_order_id_type
typedef object_id<protocol_ids, call_order_object_type, call_order_object> call_order_id_type
typedef object_id<protocol_ids, custom_object_type, custom_object> custom_id_type
typedef object_id<protocol_ids, proposal_object_type, proposal_object> proposal_id_type
typedef object_id<protocol_ids, operation_history_object_type, operation_history_object> operation_history_id_type
typedef object_id<protocol_ids, withdraw_permission_object_type, withdraw_permission_object> withdraw_permission_id_type
typedef object_id<protocol_ids, vesting_balance_object_type, vesting_balance_object> vesting_balance_id_type
typedef object_id<protocol_ids, worker_object_type, worker_object> worker_id_type
typedef object_id<protocol_ids, balance_object_type, balance_object> balance_id_type
typedef object_id<implementation_ids, impl_global_property_object_type, global_property_object> global_property_id_type
typedef object_id<implementation_ids, impl_dynamic_global_property_object_type, dynamic_global_property_object> dynamic_global_property_id_type
typedef object_id<implementation_ids, impl_asset_dynamic_data_type, asset_dynamic_data_object> asset_dynamic_data_id_type
typedef object_id<implementation_ids, impl_asset_bitasset_data_type, asset_bitasset_data_object> asset_bitasset_data_id_type
typedef object_id<implementation_ids, impl_account_balance_object_type, account_balance_object> account_balance_id_type
typedef object_id<implementation_ids, impl_account_statistics_object_type, account_statistics_object> account_statistics_id_type
typedef object_id<implementation_ids, impl_transaction_object_type, transaction_object> transaction_obj_id_type
typedef object_id<implementation_ids, impl_block_summary_object_type, block_summary_object> block_summary_id_type
typedef object_id<implementation_ids, impl_account_transaction_history_object_type, account_transaction_history_object> account_transaction_history_id_type
typedef object_id<implementation_ids, impl_chain_property_object_type, chain_property_object> chain_property_id_type
typedef object_id<implementation_ids, impl_witness_schedule_object_type, witness_schedule_object> witness_schedule_id_type
typedef object_id<implementation_ids, impl_budget_record_object_type, budget_record_object> budget_record_id_type
typedef object_id<implementation_ids, impl_blinded_balance_object_type, blinded_balance_object> blinded_balance_id_type
typedef object_id<implementation_ids, impl_special_authority_object_type, special_authority_object> special_authority_id_type
typedef object_id<implementation_ids, impl_buyback_object_type, buyback_object> buyback_id_type
typedef object_id<implementation_ids, impl_fba_accumulator_object_type, fba_accumulator_object> fba_accumulator_id_type
typedef object_id<implementation_ids, impl_collateral_bid_object_type, collateral_bid_object> collateral_bid_id_type
typedef fc::ripemd160 block_id_type
typedef fc::ripemd160 checksum_type
typedef fc::ripemd160 transaction_id_type
typedef fc::sha256 digest_type
typedef fc::ecc::compact_signature signature_type
typedef safe<int64_t> share_type
typedef uint16_t weight_type
typedef fc::static_variant<linear_vesting_policy_initializer, cdd_vesting_policy_initializer> vesting_policy_initializer
typedef static_variant<refund_worker_initializer, vesting_balance_worker_initializer, burn_worker_initializer> worker_initializer
typedef multi_index_container<special_authority_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_account>, member<special_authority_object, account_id_type, &special_authority_object::account>>>> special_authority_multi_index_type
typedef generic_index<special_authority_object, special_authority_multi_index_type> special_authority_index
typedef multi_index_container<transaction_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, hashed_unique<tag<by_trx_id>, BOOST_MULTI_INDEX_MEMBER(transaction_object, transaction_id_type, trx_id), std::hash<transaction_id_type>>, ordered_non_unique<tag<by_expiration>, const_mem_fun<transaction_object, time_point_sec, &transaction_object::get_expiration>>>> transaction_multi_index_type
typedef generic_index<transaction_object, transaction_multi_index_type> transaction_index
typedef fc::static_variant<linear_vesting_policy, cdd_vesting_policy> vesting_policy
typedef multi_index_container<vesting_balance_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_non_unique<tag<by_account>, member<vesting_balance_object, account_id_type, &vesting_balance_object::owner>>>> vesting_balance_multi_index_type
typedef generic_index<vesting_balance_object, vesting_balance_multi_index_type> vesting_balance_index
typedef multi_index_container<withdraw_permission_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_from>, composite_key<withdraw_permission_object, member<withdraw_permission_object, account_id_type, &withdraw_permission_object::withdraw_from_account>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_authorized>, composite_key<withdraw_permission_object, member<withdraw_permission_object, account_id_type, &withdraw_permission_object::authorized_account>, member<object, object_id_type, &object::id>>>, ordered_unique<tag<by_expiration>, composite_key<withdraw_permission_object, member<withdraw_permission_object, time_point_sec, &withdraw_permission_object::expiration>, member<object, object_id_type, &object::id>>>>> withdraw_permission_object_multi_index_type
typedef generic_index<withdraw_permission_object, withdraw_permission_object_multi_index_type> withdraw_permission_index
using witness_multi_index_type = multi_index_container<witness_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_unique<tag<by_account>, member<witness_object, account_id_type, &witness_object::witness_account>>, ordered_unique<tag<by_vote_id>, member<witness_object, vote_id_type, &witness_object::vote_id>>>>
using witness_index = generic_index<witness_object, witness_multi_index_type>
typedef static_variant<refund_worker_type, vesting_balance_worker_type, burn_worker_type> worker_type
typedef multi_index_container<worker_object, indexed_by<ordered_unique<tag<by_id>, member<object, object_id_type, &object::id>>, ordered_non_unique<tag<by_account>, member<worker_object, account_id_type, &worker_object::worker_account>>, ordered_unique<tag<by_vote_for>, member<worker_object, vote_id_type, &worker_object::vote_for>>, ordered_unique<tag<by_vote_against>, member<worker_object, vote_id_type, &worker_object::vote_against>>>> worker_object_multi_index_type
using worker_index = generic_index<worker_object, worker_object_multi_index_type>
typedef boost::multiprecision::uint128_t uint128_t
typedef boost::multiprecision::int128_t int128_t
typedef fc::smart_ref<fee_schedule> smart_fee_schedule


enum graphene_fba_accumulator_id_enum

An object will be created at genesis for each of these FBA accumulators.


fba_accumulator_id_transfer_to_blind = 0
enum asset_issuer_permission_flags


charge_market_fee = 0x01

an issuer-specified percentage of all market trades in this asset is paid to the issuer

white_list = 0x02

accounts must be whitelisted in order to hold this asset

override_authority = 0x04

issuer may transfer asset back to himself

require the issuer to be one party to every transfer

disable_force_settle = 0x10

disable force settling

global_settle = 0x20

allow the bitasset issuer to force a global settling this may be set in permissions, but not flags

disable_confidential = 0x40

allow the asset to be used with confidential transactions

allow the asset to be fed by witnesses

committee_fed_asset = 0x100

allow the asset to be fed by the committee

enum reserved_spaces


relative_protocol_ids = 0
protocol_ids = 1
implementation_ids = 2
enum object_type

List all object types from all namespaces here so they can be easily reflected and displayed in debug output. If a 3rd party wants to extend the core code then they will have to change the packed_object::type field from enum_type to uint16 to avoid warnings when converting packed_objects to/from json.



Sentry value which contains the number of different object types.

enum impl_object_type




void verify_authority_accounts(const database &db, const authority &a)
void verify_account_votes(const database &db, const account_options &options)
share_type cut_fee(share_type a, uint16_t p)
static void validate_new_issuer(const database &d, const asset_object &a, account_id_type new_issuer)
void check_children_of_bitasset(database &d, const asset_update_bitasset_operation &op, const asset_object &new_backing_asset, bool after_hf_922_931)
static bool update_bitasset_object_options(const asset_update_bitasset_operation &op, database &db, asset_bitasset_data_object &bdo, const asset_object &asset_to_update)
void evaluate_buyback_account_options(const database &db, const buyback_account_options &bbo)
void debug_apply_update(database &db, const fc::variant_object &vo)
template<typename Visitor>
void visit_special_authorities(const database &db, Visitor visit)
void update_top_n_authorities(database &db)
void split_fba_balance(database &db, uint64_t fba_id, uint16_t network_pct, uint16_t designated_asset_buyback_pct, uint16_t designated_asset_issuer_pct)
void distribute_fba_balances(database &db)
void create_buyback_orders(database &db)
void deprecate_annual_members(database &db)
void update_and_match_call_orders(database &db)
void process_hf_868_890(database &db, bool skip_check_call_orders)
void process_hf_935(database &db)
bool maybe_cull_small_order(database &db, const limit_order_object &order)
fc::variant_object get_config()
graphene::chain::GRAPHENE_DECLARE_OP_EVALUATE_EXCEPTION(unknown_commitment, blind_transfer, 1, "Attempting to claim an unknown prior commitment")
void operation_get_impacted_accounts(const graphene::chain::operation &op, fc::flat_set<graphene::chain::account_id_type> &result)
void transaction_get_impacted_accounts(const graphene::chain::transaction &tx, fc::flat_set<graphene::chain::account_id_type> &result)
bool is_authorized_asset(const database &d, const account_object &acct, const asset_object &asset_obj)


true if the account is whitelisted and not blacklisted to transact in the provided asset; false otherwise.

bool is_valid_name(const string &s)

Names must comply with the following grammar (RFC 1035): <domain> ::= <subdomain> | ” ” <subdomain> ::= <label> | <subdomain> “.” <label> <label> ::= <letter> [ [ <ldh-str> ] <let-dig> ] <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str> <let-dig-hyp> ::= <let-dig> | “-” <let-dig> ::= <letter> | <digit>

Which is equivalent to the following:

<domain> ::= <subdomain> | ” ” <subdomain> ::= <label> (“.” <label>)* <label> ::= <letter> [ [ <let-dig-hyp>+ ] <let-dig> ] <let-dig-hyp> ::= <let-dig> | “-” <let-dig> ::= <letter> | <digit>

I.e. a valid name consists of a dot-separated sequence of one or more labels consisting of the following rules:

  • Each label is three characters or more

  • Each label begins with a letter

  • Each label ends with a letter or digit

  • Each label contains only letters, digits or hyphens

In addition we require the following:

  • All letters are lowercase


bool is_cheap_name(const string &n)
bool operator==(const address &a, const address &b)
bool operator!=(const address &a, const address &b)
bool operator<(const address &a, const address &b)
price operator/(const asset &base, const asset &quote)
price operator~(const price &p)
bool operator<(const price &a, const price &b)
bool operator==(const price &a, const price &b)
bool operator>(const price &a, const price &b)
bool operator<=(const price &a, const price &b)
bool operator>=(const price &a, const price &b)
bool operator!=(const price &a, const price &b)
asset operator*(const asset &a, const price &b)

Multiply and round down.

price operator*(const price &p, const ratio_type &r)
price operator/(const price &p, const ratio_type &r)
price &operator*=(price &p, const ratio_type &r)
price &operator/=(price &p, const ratio_type &r)
bool is_valid_symbol(const string &symbol)

Valid symbols can contain [A-Z0-9], and ‘.’ They must start with [A, Z] They must end with [A, Z] before HF_620 or [A-Z0-9] after it They can contain a maximum of one ‘.’

void add_authority_accounts(flat_set<account_id_type> &result, const authority &a)

Add all account members of the given authority to the given flat_set.

void operation_get_required_authorities(const operation &op, flat_set<account_id_type> &active, flat_set<account_id_type> &owner, vector<authority> &other)

Appends required authorites to the result vector. The authorities appended are not the same as those returned by get_required_auth


a set of required authorities for op

void operation_validate(const operation &op)
void validate_special_authority(const special_authority &auth)
void verify_authority(const vector<operation> &ops, const flat_set<public_key_type> &sigs, const std::function<const authority *(account_id_type)> &get_active, const std::function<const authority *(account_id_type)> &get_owner, uint32_t max_recursion = GRAPHENE_MAX_SIG_CHECK_DEPTH, bool allow_committe = false, const flat_set<account_id_type> &active_aprovals = flat_set<account_id_type>(), const flat_set<account_id_type> &owner_approvals = flat_set<account_id_type>(), )
bool is_relative(object_id_type o)
vote_id_type get_next_vote_id(global_property_object &gpo, vote_id_type::vote_type type)
bool operator==(const pts_address &a, const pts_address &b)
bool operator!=(const pts_address &a, const pts_address &b)
bool operator<(const pts_address &a, const pts_address &b)
void evaluate_special_authority(const database &db, const special_authority &auth)
bool operator==(const public_key_type &p1, const fc::ecc::public_key &p2)
bool operator==(const public_key_type &p1, const public_key_type &p2)
bool operator!=(const public_key_type &p1, const public_key_type &p2)
bool operator==(const extended_public_key_type &p1, const fc::ecc::extended_public_key &p2)
bool operator==(const extended_public_key_type &p1, const extended_public_key_type &p2)
bool operator!=(const extended_public_key_type &p1, const extended_public_key_type &p2)
bool operator==(const extended_private_key_type &p1, const fc::ecc::extended_public_key &p2)
bool operator==(const extended_private_key_type &p1, const extended_private_key_type &p2)
bool operator!=(const extended_private_key_type &p1, const extended_private_key_type &p2)
bool sum_below_max_shares(const asset &a, const asset &b)
graphene::chain::VESTING_VISITOR(is_deposit_allowed, const)
graphene::chain::VESTING_VISITOR(is_deposit_vested_allowed, const)
graphene::chain::VESTING_VISITOR(is_withdraw_allowed, const)
graphene::chain::VESTING_VISITOR(get_allowed_withdraw, const)


const int64_t scaled_precision_lut = {p10<0>::v, , , , , , , , , , , , , , , , , , }
const uint32_t ASSET_ISSUER_PERMISSION_MASK = charge_market_fee | white_list | override_authority | transfer_restricted | disable_force_settle | global_settle | disable_confidential | witness_fed_asset | committee_fed_asset
const uint32_t UIA_ASSET_ISSUER_PERMISSION_MASK = charge_market_fee | white_list | override_authority | transfer_restricted | disable_confidential
smart_fee_schedule tmp
const flat_set<public_key_type> empty_keyset
class account_balance_object : public graphene::db::abstract_object<account_balance_object>
#include <account_object.hpp>

Tracks the balance of a single account/asset pair

This object is indexed on owner and asset_type so that black swan events in asset_type can be processed quickly.

Public Members

bool maintenance_flag = false

Whether need to process this balance object in maintenance interval.

struct account_create_operation : public graphene::chain::base_operation
#include <account.hpp>

Public Members

account_id_type registrar

This account pays the fee. Must be a lifetime member.

account_id_type referrer

This account receives a portion of the fee split between registrar and referrer. Must be a member.

uint16_t referrer_percent = 0

Of the fee split between registrar and referrer, this percentage goes to the referrer. The rest goes to the registrar.

struct fee_parameters_type
#include <account.hpp>

Public Members

uint64_t basic_fee = 5 * GRAPHENE_BLOCKCHAIN_PRECISION

the cost to register the cheapest non-free account

uint64_t premium_fee = 2000 * GRAPHENE_BLOCKCHAIN_PRECISION

the cost to register the cheapest non-free account

class account_member_index : public secondary_index
#include <account_object.hpp>

This secondary index will allow a reverse lookup of all accounts that a particular key or account is an potential signing authority.

Public Members

map<account_id_type, set<account_id_type>> account_to_account_memberships

given an account or key, map it to the set of accounts that reference it in an active or owner authority

map<address, set<account_id_type>> account_to_address_memberships

some accounts use address authorities in the genesis block

struct account_name_eq_lit_predicate
#include <assert.hpp>

Used to verify that account_id->name is equal to the given string literal.

Public Functions

bool validate() const

Perform state-independent checks. Verify account_name is a valid account name.

class account_object : public graphene::db::abstract_object<account_object>
#include <account_object.hpp>

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.

Unnamed Group

set<account_id_type> 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.

Public Functions

bool is_lifetime_member() const


true if this is a lifetime member account; false otherwise.

bool is_basic_account(time_point_sec now) const


true if this is a basic account; false otherwise.

bool is_annual_member(time_point_sec now) const


true if the account is an unexpired annual member; false otherwise.


This method will return false for lifetime members.

bool is_member(time_point_sec now) const


true if the account is an annual or lifetime member; false otherwise.

Public Members

time_point_sec 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

account_id_type registrar

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

account_id_type referrer

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

account_id_type lifetime_referrer

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

uint16_t network_fee_percentage = GRAPHENE_DEFAULT_NETWORK_PERCENT_OF_FEE

Percentage of fee which should go to network.

uint16_t lifetime_referrer_fee_percentage = 0

Percentage of fee which should go to lifetime referrer.

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

string name

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

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

authority active

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

account_statistics_id_type statistics

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

flat_set<account_id_type> 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.

flat_set<account_id_type> 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.

optional<vesting_balance_id_type> cashback_vb

Vesting balance which receives cashback_reward deposits.

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

optional<flat_set<asset_id_type>> 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.

struct account_options
#include <account.hpp>

These are the fields which can be updated by the active authority.

Public Functions

bool is_voting() const

Whether this account is voting.

Public Members

public_key_type memo_key

The memo key is the key this account will typically use to encrypt/sign transaction memos and other non- validated account activities. This field is here to prevent confusion if the active authority has zero or multiple keys in it.

account_id_type voting_account = GRAPHENE_PROXY_TO_SELF_ACCOUNT

If this field is set to an account ID other than GRAPHENE_PROXY_TO_SELF_ACCOUNT, then this account’s votes will be ignored; its stake will be counted as voting for the referenced account’s selected votes instead.

uint16_t num_witness = 0

The number of active witnesses this account votes the blockchain should appoint Must not exceed the actual number of witnesses voted for in votes

uint16_t num_committee = 0

The number of active committee members this account votes the blockchain should appoint Must not exceed the actual number of committee members voted for in votes

flat_set<vote_id_type> votes

This is the list of vote IDs this account votes for. The weight of these votes is determined by this account’s balance of core asset.

class account_referrer_index : public secondary_index
#include <account_object.hpp>

This secondary index will allow a reverse lookup of all accounts that have been referred by a particular account.

Public Members

map<account_id_type, set<account_id_type>> referred_by

maps the referrer to the set of accounts that they have referred

class account_statistics_object : public graphene::db::abstract_object<account_statistics_object>
#include <account_object.hpp>

This object contains regularly updated statistical data about an account. It is provided for the purpose of separating the account data that changes frequently from the account data that is mostly static, which will minimize the amount of data that must be backed up as part of the undo history everytime a transfer is made.

Public Functions

bool has_some_core_voting() const

Whether this account owns some CORE asset and is voting.

bool has_pending_fees() const

Whether this account has pending fees, no matter vested or not.

bool need_maintenance() const

Whether need to process this account during the maintenance interval.

void process_fees(const account_object &a, database &d) const

Split up and pay out pending_fees and pending_vested_fees.

void pay_fee(share_type core_fee, share_type cashback_vesting_threshold)

Core fees are paid into the account_statistics_object by this method

Public Members

string name

redundantly store account name here for better maintenance performance

account_transaction_history_id_type most_recent_op

Keep the most recent operation as a root pointer to a linked list of the transaction history.

uint32_t total_ops = 0

Total operations related to this account.

uint32_t removed_ops = 0

Total operations related to this account that has been removed from the database.

share_type total_core_in_orders

When calculating votes it is necessary to know how much is stored in orders (and thus unavailable for transfers). Rather than maintaining an index of [asset,owner,order_id] we will simply maintain the running total here and update it every time an order is created or modified.

share_type core_in_balance = 0

redundantly store core balance here for better maintenance performance

bool has_cashback_vb = false

redundantly store this for better maintenance performance

bool is_voting = false

redundately store whether this account is voting for better maintenance performance

share_type lifetime_fees_paid

Tracks the total fees paid by this account for the purpose of calculating bulk discounts.

share_type pending_fees

Tracks the fees paid by this account which have not been disseminated to the various parties that receive them yet (registrar, referrer, lifetime referrer, network, etc). This is used as an optimization to avoid doing massive amounts of uint128 arithmetic on each and every operation.

These fees will be paid out as vesting cash-back, and this counter will reset during the maintenance interval.

share_type pending_vested_fees

Same as pending_fees, except these fees will be paid out as pre-vested cash-back (immediately available for withdrawal) rather than requiring the normal vesting period.

class account_transaction_history_object : public graphene::db::abstract_object<account_transaction_history_object>
#include <operation_history_object.hpp>

a node in a linked list of operation_history_objects

Account history is important for users and wallets even though it is not part of “core validation”. Account history is maintained as a linked list stored on disk in a stack. Each account will point to the most recent account history object by ID. When a new operation relativent to that account is processed a new account history object is allcoated at the end of the stack and intialized to point to the prior object.

This data is never accessed as part of chain validation and therefore can be kept on disk as a memory mapped file. Using a memory mapped file will help the operating system better manage / cache / page files and also accelerates load time.

When the transaction history for a particular account is requested the linked list can be traversed with relatively effecient disk access because of the use of a memory mapped stack.

Public Members

operation_history_id_type operation_id

the account this operation applies to

account_transaction_history_id_type next

the operation position within the given account

struct account_transfer_operation : public graphene::chain::base_operation
#include <account.hpp>

transfers the account to another account while clearing the white list

In theory an account can be transferred by simply updating the authorities, but that kind of transfer lacks semantic meaning and is more often done to rotate keys without transferring ownership. This operation is used to indicate the legal transfer of title to this account and a break in the operation history.

The account_id’s owner/active/voting/memo authority should be set to new_owner

This operation will clear the account’s whitelist statuses, but not the blacklist statuses.

struct account_update_operation : public graphene::chain::base_operation
#include <account.hpp>

Update an existing account.

This operation is used to update an existing account. It can be used to update the authorities, or adjust the options on the account. See account_object::options_type for the options which may be updated.

Public Members

account_id_type account

The account to update.

optional<authority> owner

New owner authority. If set, this operation requires owner authority to execute.

optional<authority> active

New active authority. This can be updated by the current active authority.

optional<account_options> new_options

New account options.

struct account_upgrade_operation : public graphene::chain::base_operation
#include <account.hpp>

Manage an account’s membership status

This operation is used to upgrade an account to a member, or renew its subscription. If an account which is an unexpired annual subscription member publishes this operation with upgrade_to_lifetime_member set to false, the account’s membership expiration date will be pushed backward one year. If a basic account publishes it with upgrade_to_lifetime_member set to false, the account will be upgraded to a subscription member with an expiration date one year after the processing time of this operation.

Any account may use this operation to become a lifetime member by setting upgrade_to_lifetime_member to true. Once an account has become a lifetime member, it may not use this operation anymore.

Public Members

account_id_type account_to_upgrade

The account to upgrade; must not already be a lifetime member.

bool upgrade_to_lifetime_member = false

If true, the account will be upgraded to a lifetime member; otherwise, it will add a year to the subscription.

struct fee_parameters_type
#include <account.hpp>

Public Members

uint64_t membership_lifetime_fee = 10000 * GRAPHENE_BLOCKCHAIN_PRECISION

the cost to upgrade to a lifetime member

struct account_whitelist_operation : public graphene::chain::base_operation
#include <account.hpp>

This operation is used to whitelist and blacklist accounts, primarily for transacting in whitelisted assets

Accounts can freely specify opinions about other accounts, in the form of either whitelisting or blacklisting them. This information is used in chain validation only to determine whether an account is authorized to transact in an asset type which enforces a whitelist, but third parties can use this information for other uses as well, as long as it does not conflict with the use of whitelisted assets.

An asset which enforces a whitelist specifies a list of accounts to maintain its whitelist, and a list of accounts to maintain its blacklist. In order for a given account A to hold and transact in a whitelisted asset S, A must be whitelisted by at least one of S’s whitelist_authorities and blacklisted by none of S’s blacklist_authorities. If A receives a balance of S, and is later removed from the whitelist(s) which allowed it to hold S, or added to any blacklist S specifies as authoritative, A’s balance of S will be frozen until A’s authorization is reinstated.

This operation requires authorizing_account’s signature, but not account_to_list’s. The fee is paid by authorizing_account.

Public Members

asset fee

Paid by authorizing_account.

account_id_type authorizing_account

The account which is specifying an opinion of another account.

account_id_type account_to_list

The account being opined about.

uint8_t new_listing = no_listing

The new white and blacklist status of account_to_list, as determined by authorizing_account This is a bitfield using values defined in the account_listing enum

class address
#include <address.hpp>

a 160 bit hash of a public key

An address can be converted to or from a base58 string with 32 bit checksum.

An address is calculated as ripemd160( sha512( compressed_ecc_public_key ) )

When converted to a string, checksum calculated as the first 4 bytes ripemd160( address ) is appended to the binary address before converting to base58.

Public Functions


constructs empty / null address

address(const std::string &base58str)

converts to binary, validates checksum

address(const fc::ecc::public_key &pub)

converts to binary

address(const fc::ecc::public_key_data &pub)

converts to binary

address(const pts_address &pub)

converts to binary

operator std::string() const

converts to base58 + checksum

struct assert_operation : public graphene::chain::base_operation
#include <assert.hpp>

assert that some conditions are true.

This operation performs no changes to the database state, but can but used to verify pre or post conditions for other operations.

Public Functions

share_type calculate_fee(const fee_parameters_type &k) const

The fee for assert operations is proportional to their size, but cheaper than a data fee because they require no storage

struct asset
#include <asset.hpp>

Public Functions

asset multiply_and_round_up(const price &p) const

Multiply and round up.

class asset_bitasset_data_object : public graphene::db::abstract_object<asset_bitasset_data_object>
#include <asset_object.hpp>

contains properties that only apply to bitassets (market issued assets)

Unnamed Group

price settlement_price

In the event of a black swan, the swan price is saved in the settlement price, and all margin positions are settled at the same price with the siezed collateral being moved into the settlement fund. From this point on no further updates to the asset are permitted (no feeds, etc) and forced settlement occurs immediately when requested, using the settlement price and fund. Price at which force settlements of a black swanned asset will occur

share_type settlement_fund

Amount of collateral which is available for force settlement.

Public Functions

share_type max_force_settlement_volume(share_type current_supply) const

Calculate the maximum force settlement volume per maintenance interval, given the current share supply.

bool has_settlement() const

return true if there has been a black swan, false otherwise

bool need_to_update_cer() const

Whether need to update core_exchange_rate in asset_object.

time_point_sec feed_expiration_time() const

The time when current_feed would expire.

Public Members

asset_id_type asset_id

The asset this object belong to.

bitasset_options options

The tunable options for BitAssets are stored in this field.

flat_map<account_id_type, pair<time_point_sec, price_feed>> feeds

Feeds published for this asset. If issuer is not committee, the keys in this map are the feed publishing accounts; otherwise, the feed publishers are the currently active committee_members and witnesses and this map should be treated as an implementation detail. The timestamp on each feed is the time it was published.

price_feed current_feed

This is the currently active price feed, calculated as the median of values from the currently active feeds.

time_point_sec current_feed_publication_time

This is the publication time of the oldest feed which was factored into current_feed.

bool is_prediction_market = false

True if this asset implements a Prediction Market.

share_type force_settled_volume

This is the volume of this asset which has been force-settled this maintanence interval.

bool asset_cer_updated = false

Track whether core_exchange_rate in corresponding asset_object has updated.

bool feed_cer_updated = false

Track whether core exchange rate in current feed has updated.

struct asset_claim_fees_operation : public graphene::chain::base_operation
#include <asset_ops.hpp>

used to transfer accumulated fees back to the issuer’s balance.

Public Members

extensions_type extensions

amount_to_claim.asset_id->issuer must == issuer

struct asset_claim_pool_operation : public graphene::chain::base_operation
#include <asset_ops.hpp>

Transfers LLC from the fee pool of a specified asset back to the issuer’s balance.


fee must be paid in the asset other than the one whose pool is being drained


amount_to_claim should be specified in the core asset


amount_to_claim should be nonnegative

  • fee: Payment for the operation execution

  • issuer: Account which will be used for transfering LLC

  • asset_id: Id of the asset whose fee pool is going to be drained

  • amount_to_claim: Amount of LLC to claim from the fee pool

  • extensions: Field for future expansion

Public Members

asset amount_to_claim

fee.asset_id must != asset_id

extensions_type extensions

core asset

class asset_create_evaluator : public graphene::chain::evaluator<asset_create_evaluator>
#include <asset_evaluator.hpp>

Public Functions

void pay_fee()

override the default behavior defined by generic_evalautor which is to post the fee to fee_paying_account_stats.pending_fees

struct asset_create_operation : public graphene::chain::base_operation
#include <asset_ops.hpp>

Public Members

account_id_type issuer

This account must sign and pay the fee for this operation. Later, this account may update the asset.

string symbol

The ticker symbol of this asset.

uint8_t precision = 0

Number of digits to the right of decimal point, must be less than or equal to 12.

asset_options common_options

Options common to all assets.


common_options.core_exchange_rate technically needs to store the asset ID of this new asset. Since this ID is not known at the time this operation is created, create this price as though the new asset has instance ID 1, and the chain will overwrite it with the new asset’s ID.

optional<bitasset_options> bitasset_opts

Options only available for BitAssets. MUST be non-null if and only if the market_issued flag is set in common_options.flags

bool is_prediction_market = false

For BitAssets, set this to true if the asset implements a Prediction Market; false otherwise.

class asset_dynamic_data_object : public graphene::db::abstract_object<asset_dynamic_data_object>
#include <asset_object.hpp>

tracks the asset information that changes frequently

Because the asset_object is very large it doesn’t make sense to save an undo state for all of the parameters that never change. This object factors out the parameters of an asset that change in almost every transaction that involves the asset.

This object exists as an implementation detail and its ID should never be referenced by a blockchain operation.

Public Members

share_type current_supply

The number of shares currently in existence.

share_type confidential_supply

total asset held in confidential balances

share_type accumulated_fees

fees accumulate to be paid out over time

share_type fee_pool

in core asset

struct asset_fund_fee_pool_operation : public graphene::chain::base_operation
#include <asset_ops.hpp>

Public Members

asset fee

core asset

share_type amount

core asset

struct asset_global_settle_operation : public graphene::chain::base_operation
#include <asset_ops.hpp>

allows global settling of bitassets (black swan or prediction markets)

In order to use this operation, asset_to_settle must have the global_settle flag set

When this operation is executed all balances are converted into the backing asset at the settle_price and all open margin positions are called at the settle price. If this asset is used as backing for other bitassets, those bitassets will be force settled at their current feed price.

Public Members

account_id_type issuer

must equal asset_to_settle->issuer

struct asset_issue_operation : public graphene::chain::base_operation
#include <asset_ops.hpp>

Public Members

account_id_type issuer

Must be asset_to_issue->asset_id->issuer.

optional<memo_data> memo

user provided data encrypted to the memo key of the “to” account

class asset_object : public graphene::db::abstract_object<asset_object>
#include <asset_object.hpp>

tracks the parameters of an asset

All assets have a globally unique symbol name that controls how they are traded and an issuer who has authority over the parameters of the asset.

Public Functions

bool is_market_issued() const


true if this is a market-issued asset; false otherwise.

bool can_force_settle() const


true if users may request force-settlement of this market-issued asset; false otherwise

bool can_global_settle() const


true if the issuer of this market-issued asset may globally settle the asset; false otherwise

bool charges_market_fees() const


true if this asset charges a fee for the issuer on market operations; false otherwise

bool is_transfer_restricted() const


true if this asset may only be transferred to/from the issuer or market orders

asset amount(share_type a) const

Helper function to get an asset object with the given amount in this asset’s type.

asset amount_from_string(string amount_string) const

Convert a string amount (i.e. “123.45”) to an asset object with this asset’s type The string may have a decimal and/or a negative sign.

string amount_to_string(share_type amount) const

Convert an asset to a textual representation, i.e. “123.45”.

string amount_to_string(const asset &amount) const

Convert an asset to a textual representation, i.e. “123.45”.

string amount_to_pretty_string(share_type amount) const

Convert an asset to a textual representation with symbol, i.e. “123.45 USD”.

string amount_to_pretty_string(const asset &amount) const

Convert an asset to a textual representation with symbol, i.e. “123.45 USD”.

template<class DB>
share_type reserved(const DB &db) const

The total amount of an asset that is reserved for future issuance.

Public Members

string symbol

Ticker symbol for this asset, i.e. “USD”.

uint8_t precision = 0

Maximum number of digits after the decimal point (must be <= 12)

account_id_type issuer

ID of the account which issued this asset.

asset_dynamic_data_id_type dynamic_asset_data_id

Current supply, fee pool, and collected fees are stored in a separate object as they change frequently.

optional<asset_bitasset_data_id_type> bitasset_data_id

Extra data associated with BitAssets. This field is non-null if and only if is_market_issued() returns true.

Public Static Functions

static bool is_valid_symbol(const string &symbol)

This function does not check if any registered asset has this symbol or not; it simply checks whether the symbol would be valid.


true if symbol is a valid ticker symbol; false otherwise.

struct asset_options
#include <asset_ops.hpp>

The asset_options struct contains options available on all assets in the network.


Changes to this struct will break protocol compatibility

Public Functions

void validate() const

Perform internal consistency checks.

  • fc::exception: if any check fails

Public Members

share_type max_supply = GRAPHENE_MAX_SHARE_SUPPLY

The maximum supply of this asset which may exist at any given time. This can be as large as GRAPHENE_MAX_SHARE_SUPPLY

uint16_t market_fee_percent = 0

When this asset is traded on the markets, this percentage of the total traded will be exacted and paid to the issuer. This is a fixed point value, representing hundredths of a percent, i.e. a value of 100 in this field means a 1% fee is charged on market trades of this asset.

share_type max_market_fee = GRAPHENE_MAX_SHARE_SUPPLY

Market fees calculated as market_fee_percent of the traded volume are capped to this value.

uint16_t issuer_permissions = UIA_ASSET_ISSUER_PERMISSION_MASK

The flags which the issuer has permission to update. See asset_issuer_permission_flags.

uint16_t flags = 0

The currently active flags on this permission. See asset_issuer_permission_flags.

price core_exchange_rate = price(asset(), )

When a non-core asset is used to pay a fee, the blockchain must convert that asset to core asset in order to accept the fee. If this asset’s fee pool is funded, the chain will automatically deposite fees in this asset to its accumulated fees, and withdraw from the fee pool the same amount as converted at the core exchange rate.

flat_set<account_id_type> whitelist_authorities

A set of accounts which maintain whitelists to consult for this asset. If whitelist_authorities is non-empty, then only accounts in whitelist_authorities are allowed to hold, use, or transfer the asset.

flat_set<account_id_type> blacklist_authorities

A set of accounts which maintain blacklists to consult for this asset. If flags & white_list is set, an account may only send, receive, trade, etc. in this asset if none of these accounts appears in its account_object::blacklisting_accounts field. If the account is blacklisted, it may not transact in this asset even if it is also whitelisted.

flat_set<asset_id_type> whitelist_markets

defines the assets that this asset may be traded against in the market

flat_set<asset_id_type> blacklist_markets

defines the assets that this asset may not be traded against in the market, must not overlap whitelist

string description

data that describes the meaning/purpose of this asset, fee will be charged proportional to size of description.

struct asset_publish_feed_operation : public graphene::chain::base_operation
#include <asset_ops.hpp>

Publish price feeds for market-issued assets

Price feed providers use this operation to publish their price feeds for market-issued assets. A price feed is used to tune the market for a particular market-issued asset. For each value in the feed, the median across all committee_member feeds for that asset is calculated and the market for the asset is configured with the median of that value.

The feed in the operation contains three prices: a call price limit, a short price limit, and a settlement price. The call limit price is structured as (collateral asset) / (debt asset) and the short limit price is structured as (asset for sale) / (collateral asset). Note that the asset IDs are opposite to eachother, so if we’re publishing a feed for USD, the call limit price will be CORE/USD and the short limit price will be USD/CORE. The settlement price may be flipped either direction, as long as it is a ratio between the market-issued asset and its collateral.

Public Members

asset fee

paid for by publisher

asset_id_type asset_id

asset for which the feed is published

struct asset_reserve_operation : public graphene::chain::base_operation
#include <asset_ops.hpp>

used to take an asset out of circulation, returning to the issuer


You cannot use this operation on market-issued assets.

struct asset_settle_cancel_operation : public graphene::chain::base_operation
#include <asset_ops.hpp>

Virtual op generated when force settlement is cancelled.

Public Members

account_id_type account

Account requesting the force settlement. This account pays the fee.

asset amount

Amount of asset to force settle. This must be a market-issued asset.

struct asset_settle_operation : public graphene::chain::base_operation
#include <asset_ops.hpp>

Schedules a market-issued asset for automatic settlement

Holders of market-issued assests may request a forced settlement for some amount of their asset. This means that the specified sum will be locked by the chain and held for the settlement period, after which time the chain will choose a margin posision holder and buy the settled asset using the margin’s collateral. The price of this sale will be based on the feed price for the market-issued asset being settled. The exact settlement price will be the feed price at the time of settlement with an offset in favor of the margin position, where the offset is a blockchain parameter set in the global_property_object.

The fee is paid by account, and account must authorize this operation

Public Members

account_id_type account

Account requesting the force settlement. This account pays the fee.

asset amount

Amount of asset to force settle. This must be a market-issued asset.

struct fee_parameters_type
#include <asset_ops.hpp>

Public Members


this fee should be high to encourage small settlement requests to be performed on the market rather than via forced settlement.

Note that in the event of a black swan or prediction market close out everyone will have to pay this fee.

struct asset_symbol_eq_lit_predicate
#include <assert.hpp>

Used to verify that asset_id->symbol is equal to the given string literal.

Public Functions

bool validate() const

Perform state independent checks. Verify symbol is a valid asset symbol.

struct asset_update_bitasset_operation : public graphene::chain::base_operation
#include <asset_ops.hpp>

Update options specific to BitAssets

BitAssets have some options which are not relevant to other asset types. This operation is used to update those options an an existing BitAsset.


issuer MUST be an existing account and MUST match asset_object::issuer on asset_to_update


asset_to_update MUST be a BitAsset, i.e. asset_object::is_market_issued() returns true


fee MUST be nonnegative, and issuer MUST have a sufficient balance to pay it


new_options SHALL be internally consistent, as verified by validate()


asset_to_update will have BitAsset-specific options matching those of new_options

struct asset_update_feed_producers_operation : public graphene::chain::base_operation
#include <asset_ops.hpp>

Update the set of feed-producing accounts for a BitAsset

BitAssets have price feeds selected by taking the median values of recommendations from a set of feed producers. This operation is used to specify which accounts may produce feeds for a given BitAsset.


issuer MUST be an existing account, and MUST match asset_object::issuer on asset_to_update


issuer MUST NOT be the committee account


asset_to_update MUST be a BitAsset, i.e. asset_object::is_market_issued() returns true


fee MUST be nonnegative, and issuer MUST have a sufficient balance to pay it


Cardinality of new_feed_producers MUST NOT exceed chain_parameters::maximum_asset_feed_publishers


asset_to_update will have a set of feed producers matching new_feed_producers


All valid feeds supplied by feed producers in new_feed_producers, which were already feed producers prior to execution of this operation, will be preserved

struct asset_update_issuer_operation : public graphene::chain::base_operation
#include <asset_ops.hpp>

Update issuer of an asset

An issuer has general administrative power of an asset and in some cases also its shares issued to individuals. Thus, changing the issuer today requires the use of a separate operation that needs to be signed by the owner authority.

struct asset_update_operation : public graphene::chain::base_operation
#include <asset_ops.hpp>

Update options common to all assets

There are a number of options which all assets in the network use. These options are enumerated in the asset_options struct. This operation is used to update these options for an existing asset.


This operation cannot be used to update BitAsset-specific options. For these options, use asset_update_bitasset_operation instead.


issuer SHALL be an existing account and MUST match asset_object::issuer on asset_to_update


fee SHALL be nonnegative, and issuer MUST have a sufficient balance to pay it


new_options SHALL be internally consistent, as verified by validate()


asset_to_update will have options matching those of new_options

Public Members

optional<account_id_type> new_issuer

If the asset is to be given a new issuer, specify his ID here.

class authority
#include <authority.hpp>

Identifies a weighted set of keys and accounts that must approve operations.

Public Members

flat_map<address, weight_type> address_auths

needed for backward compatibility only

class balance_claim_evaluator : public graphene::chain::evaluator<balance_claim_evaluator>
#include <balance_evaluator.hpp>

Public Functions

void_result do_apply(const balance_claim_operation &op)


the fee is always 0 for this particular operation because once the balance is claimed it frees up memory and it cannot be used to spam the network

struct balance_claim_operation : public graphene::chain::base_operation
#include <balance.hpp>

Claim a balance in a balanc_object.

This operation is used to claim the balance in a given balance_object. If the balance object contains a vesting balance, total_claimed must not exceed balance_object::available at the time of evaluation. If the object contains a non-vesting balance, total_claimed must be the full balance of the object.

struct base_operation
#include <base.hpp>

Subclassed by graphene::chain::account_create_operation, graphene::chain::account_transfer_operation, graphene::chain::account_update_operation, graphene::chain::account_upgrade_operation, graphene::chain::account_whitelist_operation, graphene::chain::assert_operation, graphene::chain::asset_claim_fees_operation, graphene::chain::asset_claim_pool_operation, graphene::chain::asset_create_operation, graphene::chain::asset_fund_fee_pool_operation, graphene::chain::asset_global_settle_operation, graphene::chain::asset_issue_operation, graphene::chain::asset_publish_feed_operation, graphene::chain::asset_reserve_operation, graphene::chain::asset_settle_cancel_operation, graphene::chain::asset_settle_operation, graphene::chain::asset_update_bitasset_operation, graphene::chain::asset_update_feed_producers_operation, graphene::chain::asset_update_issuer_operation, graphene::chain::asset_update_operation, graphene::chain::balance_claim_operation, graphene::chain::bid_collateral_operation, graphene::chain::blind_transfer_operation, graphene::chain::call_order_update_operation, graphene::chain::committee_member_create_operation, graphene::chain::committee_member_update_global_parameters_operation, graphene::chain::committee_member_update_operation, graphene::chain::custom_operation, graphene::chain::execute_bid_operation, graphene::chain::fba_distribute_operation, graphene::chain::fill_order_operation, graphene::chain::limit_order_cancel_operation, graphene::chain::limit_order_create_operation, graphene::chain::override_transfer_operation, graphene::chain::proposal_create_operation, graphene::chain::proposal_delete_operation, graphene::chain::proposal_update_operation, graphene::chain::transfer_from_blind_operation, graphene::chain::transfer_operation, graphene::chain::transfer_to_blind_operation, graphene::chain::vesting_balance_create_operation, graphene::chain::vesting_balance_withdraw_operation, graphene::chain::withdraw_permission_claim_operation, graphene::chain::withdraw_permission_create_operation, graphene::chain::withdraw_permission_delete_operation, graphene::chain::withdraw_permission_update_operation, graphene::chain::witness_create_operation, graphene::chain::witness_update_operation, graphene::chain::worker_create_operation

struct bid_collateral_operation : public graphene::chain::base_operation
#include <market.hpp>

This operation can be used after a black swan to bid collateral for taking over part of the debt and the settlement_fund (see BSIP-0018).

Public Members

account_id_type bidder

pays fee and additional collateral

asset additional_collateral

the amount of collateral to bid for the debt

asset debt_covered

the amount of debt to take over

struct fee_parameters_type
#include <market.hpp>

should be equivalent to call_order_update fee

struct bitasset_options
#include <asset_ops.hpp>

The bitasset_options struct contains configurable options available only to BitAssets.


Changes to this struct will break protocol compatibility

Public Functions

void validate() const

Perform internal consistency checks.

  • fc::exception: if any check fails

Public Members

uint32_t feed_lifetime_sec = GRAPHENE_DEFAULT_PRICE_FEED_LIFETIME

Time before a price feed expires.

uint8_t minimum_feeds = 1

Minimum number of unexpired feeds required to extract a median feed from.

uint32_t force_settlement_delay_sec = GRAPHENE_DEFAULT_FORCE_SETTLEMENT_DELAY

This is the delay between the time a long requests settlement and the chain evaluates the settlement.

uint16_t force_settlement_offset_percent = GRAPHENE_DEFAULT_FORCE_SETTLEMENT_OFFSET

This is the percent to adjust the feed price in the short’s favor in the event of a forced settlement.

uint16_t maximum_force_settlement_volume = GRAPHENE_DEFAULT_FORCE_SETTLEMENT_MAX_VOLUME

Force settlement volume can be limited such that only a certain percentage of the total existing supply of the asset may be force-settled within any given chain maintenance interval. This field stores the percentage of the current supply which may be force settled within the current maintenance interval. If force settlements come due in an interval in which the maximum volume has already been settled, the new settlements will be enqueued and processed at the beginning of the next maintenance interval.

asset_id_type short_backing_asset

This speicifies which asset type is used to collateralize short sales This field may only be updated if the current supply of the asset is zero.

struct blind_input
#include <confidential.hpp>

Public Members

authority owner

provided to maintain the invariant that all authority required by an operation is explicit in the operation. Must match blinded_balance_id->owner

struct blind_memo
#include <confidential.hpp>

This data is encrypted and stored in the encrypted memo portion of the blind output.

Public Members

uint32_t check = 0

set to the first 4 bytes of the shared secret used to encrypt the memo. Used to verify that decryption was successful.

class blind_output
#include <confidential.hpp>

Defines data required to create a new blind commitment

The blinded output that must be proven to be greater than 0.

Public Members

range_proof_type range_proof

only required if there is more than one blind output

class blind_transfer_evaluator : public graphene::chain::evaluator<blind_transfer_evaluator>
#include <confidential_evaluator.hpp>

Public Functions

void pay_fee()

Routes the fee to where it needs to go. The default implementation routes the fee to the account_statistics_object of the fee_paying_account.

Before pay_fee() is called, the fee is computed by prepare_fee() and has been moved out of the fee_paying_account and (if paid in a non-CORE asset) converted by the asset’s fee pool.

Therefore, when pay_fee() is called, the fee only exists in this->core_fee_paid. So pay_fee() need only increment the receiving balance.

The default implementation simply calls account_statistics_object->pay_fee() to increment pending_fees or pending_vested_fees.

struct blind_transfer_operation : public graphene::chain::base_operation
#include <confidential.hpp>

Transfers from blind to blind.

There are two ways to transfer value while maintaining privacy:

  1. account to account with amount kept secret

  2. stealth transfers with amount sender/receiver kept secret

When doing account to account transfers, everyone with access to the memo key can see the amounts, but they will not have access to the funds.

When using stealth transfers the same key is used for control and reading the memo.

This operation is more expensive than a normal transfer and has a fee proportional to the size of the operation.

All assets in a blind transfer must be of the same type: fee.asset_id The fee_payer is the temp account and can be funded from the blinded values.

Using this operation you can transfer from an account and/or blinded balances to an account and/or blinded balances.

Stealth Transfers:

Assuming Receiver has key pair R,r and has shared public key R with Sender Assuming Sender has key pair S,s Generate one time key pair O,o as s.child(nonce) where nonce can be inferred from transaction Calculate secret V = o*R blinding_factor = sha256(V) memo is encrypted via aes of V owner = R.child(sha256(blinding_factor))

Sender gives Receiver output ID to complete the payment.

This process can also be used to send money to a cold wallet without having to pre-register any accounts.

Outputs are assigned the same IDs as the inputs until no more input IDs are available, in which case a the return value will be the first ID allocated for an output. Additional output IDs are allocated sequentially thereafter. If there are fewer outputs than inputs then the input IDs are freed and never used again.

Public Functions

account_id_type fee_payer() const

graphene TEMP account

If fee_payer = temp_account_id, then the fee is paid by the surplus balance of inputs-outputs and 100% of the fee goes to the network.

void validate() const

This method can be computationally intensive because it verifies that input commitments - output commitments add up to 0

struct fee_parameters_type
#include <confidential.hpp>

Public Members


the cost to register the cheapest non-free account

class blinded_balance_object : public graphene::db::abstract_object<blinded_balance_object>
#include <confidential_object.hpp>

tracks a blinded balance commitment

struct block_header
#include <block.hpp>

Subclassed by graphene::chain::signed_block_header

struct block_id_predicate
#include <assert.hpp>

Used to verify that a specific block is part of the blockchain history. This helps protect some high-value transactions to newly created IDs

The block ID must be within the last 2^16 blocks.

class block_summary_object : public graphene::db::abstract_object<block_summary_object>
#include <block_summary_object.hpp>

tracks minimal information about past blocks to implement TaPOS

When attempting to calculate the validity of a transaction we need to lookup a past block and check its block hash and the time it occurred so we can calculate whether the current transaction is valid and at what time it should expire.

struct burn_worker_type
#include <worker_object.hpp>

A worker who permanently destroys all of his pay.

This worker sends all pay he receives to the null account.

Public Members

share_type total_burned

Record of how much this worker has burned in his lifetime.

struct buyback_account_options
#include <buyback.hpp>

Public Members

asset_id_type asset_to_buy

The asset to buy.

account_id_type asset_to_buy_issuer

Issuer of the asset. Must sign the transaction, must match issuer of specified asset.

flat_set<asset_id_type> markets

What assets the account is willing to buy with. Other assets will just sit there since the account has null authority.

class buyback_object : public graphene::db::abstract_object<buyback_object>
#include <buyback_object.hpp>

buyback_authority_object only exists to help with a specific indexing problem. We want to be able to iterate over all assets that have a buyback program. However, assets which have a buyback program are very rare. So rather than indexing asset_object by the buyback field (requiring additional bookkeeping for every asset), we instead maintain a buyback_object pointing to each asset which has buyback (requiring additional bookkeeping only for every asset which has buyback).

This class is an implementation detail.

class call_order_object : public graphene::db::abstract_object<call_order_object>
#include <market_object.hpp>

tracks debt and call price information

There should only be one call_order_object per asset pair per account and they will all have the same call price.

Public Functions

share_type get_max_debt_to_cover(price match_price, price feed_price, const uint16_t maintenance_collateral_ratio) const

Calculate maximum quantity of debt to cover to satisfy target_collateral_ratio.

Public Members

share_type collateral

call_price.base.asset_id, access via get_collateral

share_type debt

call_price.quote.asset_id, access via get_debt

price call_price

Collateral / Debt.

optional<uint16_t> target_collateral_ratio

maximum CR to maintain when selling collateral on margin call

struct call_order_update_operation : public graphene::chain::base_operation
#include <market.hpp>

This operation can be used to add collateral, cover, and adjust the margin call price for a particular user.

For prediction markets the collateral and debt must always be equal.

This operation will fail if it would trigger a margin call that couldn’t be filled. If the margin call hits the call price limit then it will fail if the call price is above the settlement price.


this operation can be used to force a market order using the collateral without requiring outside funds.

Public Members

account_id_type funding_account

pays fee, collateral, and cover

asset delta_collateral

the amount of collateral to add to the margin position

asset delta_debt

the amount of the debt to be paid off, may be negative to issue new debt

struct fee_parameters_type
#include <market.hpp>

this is slightly more expensive than limit orders, this pricing impacts prediction markets

struct options_type
#include <market.hpp>

Options to be used in call_order_update_operation.


this struct can be expanded by adding more options in the end.

Public Members

optional<uint16_t> target_collateral_ratio

maximum CR to maintain when selling collateral on margin call

struct cdd_vesting_policy
#include <vesting_balance_object.hpp>

defines vesting in terms of coin-days accrued which allows for dynamic deposit/withdraw

The economic effect of this vesting policy is to require a certain amount of “interest” to accrue before the full balance may be withdrawn. Interest accrues as coindays (balance * length held). If some of the balance is withdrawn, the remaining balance must be held longer.

Public Functions

fc::uint128_t compute_coin_seconds_earned(const vesting_policy_context &ctx) const

Compute coin_seconds_earned. Used to non-destructively figure out how many coin seconds are available.

void update_coin_seconds_earned(const vesting_policy_context &ctx)

Update coin_seconds_earned and coin_seconds_earned_last_update fields; called by both on_deposit() and on_withdraw().

Public Members

fc::time_point_sec start_claim

while coindays may accrue over time, none may be claimed before first_claim date

struct cdd_vesting_policy_initializer
#include <vesting.hpp>

Public Members

fc::time_point_sec start_claim

while coindays may accrue over time, none may be claimed before the start_claim time

struct chain_parameters
#include <chain_parameters.hpp>

Public Functions

void validate() const

defined in fee_schedule.cpp

Public Members

smart_ref<fee_schedule> current_fees

current schedule of fees

using a smart ref breaks the circular dependency created between operations and the fee schedule

uint8_t block_interval = GRAPHENE_DEFAULT_BLOCK_INTERVAL

interval in seconds between blocks

uint32_t maintenance_interval = GRAPHENE_DEFAULT_MAINTENANCE_INTERVAL

interval in sections between blockchain maintenance events

uint8_t maintenance_skip_slots = GRAPHENE_DEFAULT_MAINTENANCE_SKIP_SLOTS

number of block_intervals to skip at maintenance time

uint32_t committee_proposal_review_period = GRAPHENE_DEFAULT_COMMITTEE_PROPOSAL_REVIEW_PERIOD_SEC

minimum time in seconds that a proposed transaction requiring committee authority may not be signed, prior to expiration

uint32_t maximum_transaction_size = GRAPHENE_DEFAULT_MAX_TRANSACTION_SIZE

maximum allowable size in bytes for a transaction

uint32_t maximum_block_size = GRAPHENE_DEFAULT_MAX_BLOCK_SIZE

maximum allowable size in bytes for a block

uint32_t maximum_time_until_expiration = GRAPHENE_DEFAULT_MAX_TIME_UNTIL_EXPIRATION

maximum lifetime in seconds for transactions to be valid, before expiring

uint32_t maximum_proposal_lifetime = GRAPHENE_DEFAULT_MAX_PROPOSAL_LIFETIME_SEC

maximum lifetime in seconds for proposed transactions to be kept, before expiring

uint8_t maximum_asset_whitelist_authorities = GRAPHENE_DEFAULT_MAX_ASSET_WHITELIST_AUTHORITIES

maximum number of accounts which an asset may list as authorities for its whitelist OR blacklist

uint8_t maximum_asset_feed_publishers = GRAPHENE_DEFAULT_MAX_ASSET_FEED_PUBLISHERS

the maximum number of feed publishers for a given asset

uint16_t maximum_witness_count = GRAPHENE_DEFAULT_MAX_WITNESSES

maximum number of active witnesses

uint16_t maximum_committee_count = GRAPHENE_DEFAULT_MAX_COMMITTEE

maximum number of active committee_members

uint16_t maximum_authority_membership = GRAPHENE_DEFAULT_MAX_AUTHORITY_MEMBERSHIP

largest number of keys/accounts an authority can have

uint16_t reserve_percent_of_fee = GRAPHENE_DEFAULT_BURN_PERCENT_OF_FEE

the percentage of the network’s allocation of a fee that is taken out of circulation

uint16_t network_percent_of_fee = GRAPHENE_DEFAULT_NETWORK_PERCENT_OF_FEE

percent of transaction fees paid to network

uint16_t lifetime_referrer_percent_of_fee = GRAPHENE_DEFAULT_LIFETIME_REFERRER_PERCENT_OF_FEE

percent of transaction fees paid to network

uint32_t cashback_vesting_period_seconds = GRAPHENE_DEFAULT_CASHBACK_VESTING_PERIOD_SEC

time after cashback rewards are accrued before they become liquid

share_type cashback_vesting_threshold = GRAPHENE_DEFAULT_CASHBACK_VESTING_THRESHOLD

the maximum cashback that can be received without vesting

bool count_non_member_votes = true

set to false to restrict voting privlegages to member accounts

bool allow_non_member_whitelists = false

true if non-member accounts may set whitelists and blacklists; false otherwise

share_type witness_pay_per_block = GRAPHENE_DEFAULT_WITNESS_PAY_PER_BLOCK

CORE to be allocated to witnesses (per block)

uint32_t witness_pay_vesting_seconds = GRAPHENE_DEFAULT_WITNESS_PAY_VESTING_SECONDS

vesting_seconds parameter for witness VBO’s

share_type worker_budget_per_day = GRAPHENE_DEFAULT_WORKER_BUDGET_PER_DAY

CORE to be allocated to workers (per day)

uint16_t max_predicate_opcode = GRAPHENE_DEFAULT_MAX_ASSERT_OPCODE

predicate_opcode must be less than this number

share_type fee_liquidation_threshold = GRAPHENE_DEFAULT_FEE_LIQUIDATION_THRESHOLD

value in CORE at which accumulated fees in blockchain-issued market assets should be liquidated

uint16_t accounts_per_fee_scale = GRAPHENE_DEFAULT_ACCOUNTS_PER_FEE_SCALE

number of accounts between fee scalings

uint8_t account_fee_scale_bitshifts = GRAPHENE_DEFAULT_ACCOUNT_FEE_SCALE_BITSHIFTS

number of times to left bitshift account registration fee at each scaling

class chain_property_object : public graphene::db::abstract_object<chain_property_object>
#include <chain_property_object.hpp>

Contains invariants which are set at genesis and never changed.

class collateral_bid_object : public graphene::db::abstract_object<collateral_bid_object>
#include <market_object.hpp>

bids of collateral for debt after a black swan

There should only be one collateral_bid_object per asset per account, and only for smartcoin assets that have a global settlement_price.

struct committee_member_create_operation : public graphene::chain::base_operation
#include <committee_member.hpp>

Create a committee_member object, as a bid to hold a committee_member seat on the network.

Accounts which wish to become committee_members may use this operation to create a committee_member object which stakeholders may vote on to approve its position as a committee_member.

Public Members

account_id_type committee_member_account

The account which owns the committee_member. This account pays the fee for this operation.

class committee_member_object : public graphene::db::abstract_object<committee_member_object>
#include <committee_member_object.hpp>

tracks information about a committee_member account.

A committee_member is responsible for setting blockchain parameters and has dynamic multi-sig control over the committee account. The current set of active committee_members has control.

committee_members were separated into a separate object to make iterating over the set of committee_member easy.

struct committee_member_update_global_parameters_operation : public graphene::chain::base_operation
#include <committee_member.hpp>

Used by committee_members to update the global parameters of the blockchain.

This operation allows the committee_members to update the global parameters on the blockchain. These control various tunable aspects of the chain, including block and maintenance intervals, maximum data sizes, the fees charged by the network, etc.

This operation may only be used in a proposed transaction, and a proposed transaction which contains this operation must have a review period specified in the current global parameters before it may be accepted.

struct committee_member_update_operation : public graphene::chain::base_operation
#include <committee_member.hpp>

Update a committee_member object.

Currently the only field which can be updated is the url field.

Public Members

committee_member_id_type committee_member

The committee member to update.

account_id_type committee_member_account

The account which owns the committee_member. This account pays the fee for this operation.

struct custom_operation : public graphene::chain::base_operation
#include <custom.hpp>

provides a generic way to add higher level protocols on top of witness consensus

There is no validation for this operation other than that required auths are valid and a fee is paid that is appropriate for the data contained.

class database : public object_database
#include <database.hpp>

tracks the blockchain state in an extensible manner

Unnamed Group

void globally_settle_asset(const asset_object &bitasset, const price &settle_price)

Market Helpers

All margin positions are force closed at the swan price Collateral received goes into a force-settlement fund No new margin positions can be created for this asset Force settlement happens without delay at the swan price, deducting from force-settlement fund No more asset updates may be issued.

bool apply_order_before_hardfork_625(const limit_order_object &new_order_object, bool allow_black_swan = true)

Process a new limit order through the markets.

This function takes a new limit order, and runs the markets attempting to match it with existing orders already on the books.


true if order was completely filled; false otherwise

  • order: The new order to process

int match(const limit_order_object &taker, const limit_order_object &maker, const price &trade_price)

Matches the two orders, the first parameter is taker, the second is maker.

0 - no orders were matched 1 - taker was filled 2 - maker was filled 3 - both were filled


a bit field indicating which orders were filled (and thus removed)

asset match(const call_order_object &call, const force_settlement_object &settle, const price &match_price, asset max_settlement, const price &fill_price)


the amount of asset settled

Unnamed Group

std::deque<signed_transaction> _popped_tx

when popping a block, the transactions that were removed get cached here so they can be reapplied at the proper time

processed_transaction validate_transaction(const signed_transaction &trx)

This method validates transactions without adding it to the pending state.


true if the transaction would validate

Public Functions

void open(const fc::path &data_dir, std::function<genesis_state_type()> genesis_loaderconst std::string &db_version, )

Open a database, creating a new one if necessary.

Opens a database in the specified directory. If no initialized database is found, genesis_loader is called and its return value is used as the genesis state when initializing the new database

genesis_loader will not be called if an existing database is found.

  • data_dir: Path to open or create database in

  • genesis_loader: A callable object which returns the genesis state to initialize new databases on

  • db_version: a version string that changes when the internal database format and/or logic is modified

void reindex(fc::path data_dir)

Rebuild object graph from block history and open detabase.

This method may be called after or instead of database::open, and will rebuild the object graph by replaying blockchain history. When this method exits successfully, the database will be open.

void wipe(const fc::path &data_dir, bool include_blocks)

wipe Delete database from disk, and potentially the raw chain as well.

Will close the database before wiping. Database will be closed when this function returns.

  • include_blocks: If true, delete the raw chain as well as the database.

bool is_known_block(const block_id_type &id) const


true if the block is in our fork DB or saved to disk as part of the official chain, otherwise return false

bool is_known_transaction(const transaction_id_type &id) const

Only return true if the transaction has not expired or been invalidated. If this method is called with a VERY old transaction we will return false, they should query things by blocks if they are that old.

uint32_t witness_participation_rate() const

Calculate the percent of block production slots that were missed in the past 128 blocks, not including the current block.

bool push_block(const signed_block &b, uint32_t skip = skip_nothing)

Push block “may fail” in which case every partial change is unwound. After push block is successful the block is appended to the chain database on disk.


true if we switched forks as a result of this push.

processed_transaction push_transaction(const signed_transaction &trx, uint32_t skip = skip_nothing)

Attempts to push the transaction into the pending queue

When called to push a locally generated transaction, set the skip_block_size_check bit on the skip argument. This will allow the transaction to be pushed even if it causes the pending block size to exceed the maximum block size. Although the transaction will probably not propagate further now, as the peers are likely to have their pending queues full as well, it will be kept in the queue to be propagated later when a new block flushes out the pending queues.

processed_transaction push_proposal(const proposal_object &proposal)

  • fc::exception: if the proposed transaction fails to apply.

void pop_block()

Removes the most recent block from the database and undoes any changes it made.

uint32_t push_applied_operation(const operation &op)

This method is used to track appied operations during the evaluation of a block, these operations should include any operation actually included in a transaction as well as any implied/virtual operations that resulted, such as filling an order. The applied operations is cleared after applying each block and calling the block observers which may want to index these operations.


the op_id which can be used to set the result after it has finished being applied.

witness_id_type get_scheduled_witness(uint32_t slot_num) const

Get the witness scheduled for block production in a slot.

slot_num always corresponds to a time in the future.

If slot_num == 1, returns the next scheduled witness. If slot_num == 2, returns the next scheduled witness after 1 block gap.

Use the get_slot_time() and get_slot_at_time() functions to convert between slot_num and timestamp.

Passing slot_num == 0 returns GRAPHENE_NULL_WITNESS

fc::time_point_sec get_slot_time(uint32_t slot_num) const

Get the time at which the given slot occurs.

If slot_num == 0, return time_point_sec().

If slot_num == N for N > 0, return the Nth next block-interval-aligned time greater than head_block_time().

uint32_t get_slot_at_time(fc::time_point_sec when) const

Get the last slot which occurs AT or BEFORE the given time.

The return value is the greatest value N such that get_slot_time( N ) <= when.

If no such N exists, return 0.

void initialize_indexes()

Reset the object graph in-memory.

asset get_balance(account_id_type owner, asset_id_type asset_id) const

Retrieve a particular account’s balance in a given asset.


owner’s balance in asset

  • owner: Account whose balance should be retrieved

  • asset_id: ID of the asset to get balance in

asset get_balance(const account_object &owner, const asset_object &asset_obj) const

This is an overloaded method.

void adjust_balance(account_id_type account, asset delta)

Adjust a particular account’s balance in a given asset by a delta.

  • account: ID of account whose balance should be adjusted

  • delta: Asset ID and amount to adjust balance by

optional<vesting_balance_id_type> deposit_lazy_vesting(const optional<vesting_balance_id_type> &ovbid, share_type amount, uint32_t req_vesting_seconds, account_id_type req_owner, bool require_vesting)

Helper to make lazy deposit to CDD VBO.

If the given optional VBID is not valid(), or it does not have a CDD vesting policy, or the owner / vesting_seconds of the policy does not match the parameter, then credit amount to newly created VBID and return it.

Otherwise, credit amount to ovbid.


ID of newly created VBO, but only if VBO was created.

void debug_dump()

This method dumps the state of the blockchain in a semi-human readable form for the purpose of tracking down funds and mismatches in currency allocation

bool fill_limit_order(const limit_order_object &order, const asset &pays, const asset &receives, bool cull_if_small, const price &fill_price, const bool is_maker)


true if the order was completely filled and thus freed.

bool check_call_orders(const asset_object &mia, bool enable_black_swan = true, bool for_new_limit_order = false, const asset_bitasset_data_object *bitasset_ptr = nullptr)

Starting with the least collateralized orders, fill them if their call price is above the max(lowest bid,call_limit).

This method will return true if it filled a short or limit


true if a margin call was executed.

  • mia: - the market issued asset that should be called.

  • enable_black_swan: - when adjusting collateral, triggering a black swan is invalid and will throw if enable_black_swan is not set to true.

  • for_new_limit_order: - true if this function is called when matching call orders with a new limit order

void enable_standby_votes_tracking(bool enable)

Enable or disable tracking of votes of standby witnesses and committee members.

Public Members

fc::signal<void(const signed_block&)> applied_block

This signal is emitted after all operations and virtual operation for a block have been applied but before the get_applied_operations() are cleared.

You may not yield from this callback because the blockchain is holding the write lock and may be in an “inconstant state” until after it is released.

fc::signal<void(const signed_transaction&)> on_pending_transaction

This signal is emitted any time a new transaction is added to the pending block state.

fc::signal<void(const vector<object_id_type>&, const flat_set<account_id_type>&)> new_objects

Emitted After a block has been applied and committed. The callback should not yield and should execute quickly.

fc::signal<void(const vector<object_id_type>&, const flat_set<account_id_type>&)> changed_objects

Emitted After a block has been applied and committed. The callback should not yield and should execute quickly.

fc::signal<void(const vector<object_id_type>&, const vector<const object *>&, const flat_set<account_id_type>&)> removed_objects

this signal is emitted any time an object is removed and contains a pointer to the last value of every object that was removed.

class dynamic_global_property_object : public graphene::db::abstract_object<dynamic_global_property_object>
#include <global_property_object.hpp>

Maintains global state information (committee_member list, current fees)

This is an implementation detail. The values here are calculated during normal chain operations and reflect the current values of global blockchain properties.

Public Members

uint32_t recently_missed_count = 0

Every time a block is missed this increases by RECENTLY_MISSED_COUNT_INCREMENT, every time a block is found it decreases by RECENTLY_MISSED_COUNT_DECREMENT. It is never less than 0.

If the recently_missed_count hits 2*UNDO_HISTORY then no new blocks may be pushed.

uint64_t current_aslot = 0

The current absolute slot number. Equal to the total number of slots since genesis. Also equal to the total number of missed slots plus head_block_number.

fc::uint128_t recent_slots_filled

used to compute witness participation.

uint32_t dynamic_flags = 0

dynamic_flags specifies chain state properties that can be expressed in one bit.

template<typename DerivedEvaluator>
class evaluator : public graphene::chain::generic_evaluator
#include <evaluator.hpp>

Public Functions

virtual operation_result evaluate(const operation &op)


derived classes should ASSUME that the default validation that is indepenent of chain state should be performed by op.validate() and should not perform these extra checks.

struct execute_bid_operation : public graphene::chain::base_operation
#include <market.hpp>


This is a virtual operation that is created while reviving a bitasset from collateral bids.

Public Functions

share_type calculate_fee(const fee_parameters_type &k) const

This is a virtual operation; there is no fee.

class fba_accumulator_object : public graphene::db::abstract_object<fba_accumulator_object>
#include <fba_object.hpp>

fba_accumulator_object accumulates fees to be paid out via buyback or other FBA mechanism.

struct fee_schedule
#include <fee_schedule.hpp>

contains all of the parameters necessary to calculate the fee for any operation

Public Functions

asset calculate_fee(const operation &op, const price &core_exchange_rate = price::unit_price()) const

Finds the appropriate fee parameter struct for the operation and then calculates the appropriate fee.

void validate() const

Validates all of the parameters are present and accounted for.

Public Members

flat_set<fee_parameters> parameters


must be sorted by fee_parameters.which() and have no duplicates

uint32_t scale = GRAPHENE_100_PERCENT

fee * scale / GRAPHENE_100_PERCENT

struct fill_order_operation : public graphene::chain::base_operation
#include <market.hpp>


This is a virtual operation that is created while matching orders and emitted for the purpose of accurately tracking account history, accelerating a reindex.

Public Functions

share_type calculate_fee(const fee_parameters_type &k) const

This is a virtual operation; there is no fee.

class force_settlement_object : public graphene::db::abstract_object<force_settlement_object>
#include <market_object.hpp>

tracks bitassets scheduled for force settlement at some point in the future.

On the settlement_date the balance will be converted to the collateral asset and paid to owner and then this object will be deleted.

class fork_database
#include <fork_database.hpp>

As long as blocks are pushed in order the fork database will maintain a linked tree of all blocks that branch from the start_block. The tree will have a maximum depth of 1024 blocks after which the database will start lopping off forks.

Every time a block is pushed into the fork DB the block with the highest block_num will be returned.

Public Functions

shared_ptr<fork_item> push_block(const signed_block &b)

Pushes the block into the fork database and caches it if it doesn’t link


the new head block ( the longest fork )

pair<fork_database::branch_type, fork_database::branch_type> fetch_branch_from(block_id_type first, block_id_type second) const

Given two head blocks, return two branches of the fork graph that end with a common ancestor (same prior block)

Public Static Attributes

const int MAX_BLOCK_REORDERING = 1024

The maximum number of blocks that may be skipped in an out-of-order push.

class generic_evaluator
#include <evaluator.hpp>

Subclassed by graphene::chain::evaluator< account_create_evaluator >, graphene::chain::evaluator< account_update_evaluator >, graphene::chain::evaluator< account_upgrade_evaluator >, graphene::chain::evaluator< account_whitelist_evaluator >, graphene::chain::evaluator< assert_evaluator >, graphene::chain::evaluator< asset_claim_fees_evaluator >, graphene::chain::evaluator< asset_claim_pool_evaluator >, graphene::chain::evaluator< asset_create_evaluator >, graphene::chain::evaluator< asset_fund_fee_pool_evaluator >, graphene::chain::evaluator< asset_global_settle_evaluator >, graphene::chain::evaluator< asset_issue_evaluator >, graphene::chain::evaluator< asset_publish_feeds_evaluator >, graphene::chain::evaluator< asset_reserve_evaluator >, graphene::chain::evaluator< asset_settle_evaluator >, graphene::chain::evaluator< asset_update_bitasset_evaluator >, graphene::chain::evaluator< asset_update_evaluator >, graphene::chain::evaluator< asset_update_feed_producers_evaluator >, graphene::chain::evaluator< asset_update_issuer_evaluator >, graphene::chain::evaluator< balance_claim_evaluator >, graphene::chain::evaluator< bid_collateral_evaluator >, graphene::chain::evaluator< blind_transfer_evaluator >, graphene::chain::evaluator< call_order_update_evaluator >, graphene::chain::evaluator< committee_member_create_evaluator >, graphene::chain::evaluator< committee_member_update_evaluator >, graphene::chain::evaluator< committee_member_update_global_parameters_evaluator >, graphene::chain::evaluator< custom_evaluator >, graphene::chain::evaluator< limit_order_cancel_evaluator >, graphene::chain::evaluator< limit_order_create_evaluator >, graphene::chain::evaluator< override_transfer_evaluator >, graphene::chain::evaluator< proposal_create_evaluator >, graphene::chain::evaluator< proposal_delete_evaluator >, graphene::chain::evaluator< proposal_update_evaluator >, graphene::chain::evaluator< transfer_evaluator >, graphene::chain::evaluator< transfer_from_blind_evaluator >, graphene::chain::evaluator< transfer_to_blind_evaluator >, graphene::chain::evaluator< vesting_balance_create_evaluator >, graphene::chain::evaluator< vesting_balance_withdraw_evaluator >, graphene::chain::evaluator< withdraw_permission_claim_evaluator >, graphene::chain::evaluator< withdraw_permission_create_evaluator >, graphene::chain::evaluator< withdraw_permission_delete_evaluator >, graphene::chain::evaluator< withdraw_permission_update_evaluator >, graphene::chain::evaluator< witness_create_evaluator >, graphene::chain::evaluator< witness_update_evaluator >, graphene::chain::evaluator< worker_create_evaluator >, graphene::chain::evaluator< DerivedEvaluator >

Public Functions

virtual operation_result evaluate(const operation &op) = 0


derived classes should ASSUME that the default validation that is indepenent of chain state should be performed by op.validate() and should not perform these extra checks.

void pay_fee()

Routes the fee to where it needs to go. The default implementation routes the fee to the account_statistics_object of the fee_paying_account.

Before pay_fee() is called, the fee is computed by prepare_fee() and has been moved out of the fee_paying_account and (if paid in a non-CORE asset) converted by the asset’s fee pool.

Therefore, when pay_fee() is called, the fee only exists in this->core_fee_paid. So pay_fee() need only increment the receiving balance.

The default implementation simply calls account_statistics_object->pay_fee() to increment pending_fees or pending_vested_fees.

struct genesis_state_type
#include <genesis_state.hpp>

Public Functions

chain_id_type compute_chain_id() const

Get the chain_id corresponding to this genesis state.

This is the SHA256 serialization of the genesis_state.

Public Members

chain_id_type initial_chain_id

Temporary, will be moved elsewhere.

struct initial_committee_member_type
#include <genesis_state.hpp>

Public Members

string owner_name

Must correspond to one of the initial accounts.

struct initial_witness_type
#include <genesis_state.hpp>

Public Members

string owner_name

Must correspond to one of the initial accounts.

struct initial_worker_type
#include <genesis_state.hpp>

Public Members

string owner_name

Must correspond to one of the initial accounts.

class global_property_object : public graphene::db::abstract_object<global_property_object>
#include <global_property_object.hpp>

Maintains global state information (committee_member list, current fees)

This is an implementation detail. The values here are set by committee_members to tune the blockchain parameters.

struct limit_order_cancel_operation : public graphene::chain::base_operation
#include <market.hpp>

Used to cancel an existing limit order. Both fee_pay_account and the account to receive the proceeds must be the same as order->seller.


the amount actually refunded

Public Members

account_id_type fee_paying_account

must be order->seller

class limit_order_create_evaluator : public graphene::chain::evaluator<limit_order_create_evaluator>
#include <market_evaluator.hpp>

Public Functions

void convert_fee()

override the default behavior defined by generic_evalautor

void pay_fee()

override the default behavior defined by generic_evalautor which is to post the fee to fee_paying_account_stats.pending_fees

class limit_order_create_operation : public graphene::chain::base_operation
#include <market.hpp>

instructs the blockchain to attempt to sell one asset for another

The blockchain will atempt to sell amount_to_sell.asset_id for as much min_to_receive.asset_id as possible. The fee will be paid by the seller’s account. Market fees will apply as specified by the issuer of both the selling asset and the receiving asset as a percentage of the amount exchanged.

If either the selling asset or the receiving asset is white list restricted, the order will only be created if the seller is on the white list of the restricted asset type.

Market orders are matched in the order they are included in the block chain.

Public Members

time_point_sec expiration = time_point_sec::maximum()

The order will be removed from the books if not filled by expiration Upon expiration, all unsold asset will be returned to seller

bool fill_or_kill = false

If this flag is set the entire order must be filled or the operation is rejected.

class limit_order_object : public graphene::db::abstract_object<limit_order_object>
#include <market_object.hpp>

an offer to sell a amount of a asset at a specified exchange rate by a certain time

This limit_order_objects are indexed by expiration and is automatically deleted on the first block after expiration.

Public Members

share_type for_sale

asset id is sell_price.base.asset_id

share_type deferred_fee

fee converted to CORE

asset deferred_paid_fee

originally paid fee

struct linear_vesting_policy
#include <vesting_balance_object.hpp>

Linear vesting balance with cliff.

This vesting balance type is used to mimic traditional stock vesting contracts where each day a certain amount vests until it is fully matured.


New funds may not be added to a linear vesting balance.

Public Members

fc::time_point_sec begin_timestamp

This is the time at which funds begin vesting.

uint32_t vesting_cliff_seconds = 0

No amount may be withdrawn before this many seconds of the vesting period have elapsed.

uint32_t vesting_duration_seconds = 0

Duration of the vesting period, in seconds. Must be greater than 0 and greater than vesting_cliff_seconds.

share_type begin_balance

The total amount of asset to vest.

struct linear_vesting_policy_initializer
#include <vesting.hpp>

Public Members

fc::time_point_sec begin_timestamp

while vesting begins on begin_timestamp, none may be claimed before vesting_cliff_seconds have passed

struct memo_data
#include <memo.hpp>

defines the keys used to derive the shared secret

Because account authorities and keys can change at any time, each memo must capture the specific keys used to derive the shared secret. In order to read the cipher message you will need one of the two private keys.

If from == to and from == 0 then no encryption is used, the memo is public. If from == to and from != 0 then invalid memo data

Public Functions

void set_message(const fc::ecc::private_key &priv, const fc::ecc::public_key &pub, const string &msg, uint64_t custom_nonce = 0)


custom_nonce is for debugging only; do not set to a nonzero value in production

Public Members

uint64_t nonce = 0

64 bit nonce format: [ 8 bits | 56 bits ] [ entropy | timestamp ] Timestamp is number of microseconds since the epoch Entropy is a byte taken from the hash of a new private key

This format is not mandated or verified; it is chosen to ensure uniqueness of key-IV pairs only. This should be unique with high probability as long as the generating host has a high-resolution clock OR a strong source of entropy for generating private keys.

vector<char> message

This field contains the AES encrypted packed memo_message

struct memo_message
#include <memo.hpp>

defines a message and checksum to enable validation of successful decryption

When encrypting/decrypting a checksum is required to determine whether or not decryption was successful.

class node_property_object
#include <node_property_object.hpp>

Contains per-node database configuration.

Transactions are evaluated differently based on per-node state. Settings here may change based on whether the node is syncing or up-to-date. Or whether the node is a witness node. Or if we’re processing a transaction in a witness-signed block vs. a fresh transaction from the p2p network. Or configuration-specified tradeoffs of performance/hardfork resilience vs. paranoia.

class op_evaluator
#include <evaluator.hpp>

Subclassed by graphene::chain::op_evaluator_impl< T >

struct op_wrapper
#include <operations.hpp>

necessary to support nested operations inside the proposal_create_operation

class operation_history_object : public graphene::db::abstract_object<operation_history_object>
#include <operation_history_object.hpp>

tracks the history of all logical operations on blockchain state

All operations and virtual operations result in the creation of an operation_history_object that is maintained on disk as a stack. Each real or virtual operation is assigned a unique ID / sequence number that it can be referenced by.


by default these objects are not tracked, the account_history_plugin must be loaded fore these objects to be maintained.


this object is READ ONLY it can never be modified

Public Members

uint32_t block_num = 0

the block that caused this operation

uint16_t trx_in_block = 0

the transaction in the block

uint16_t op_in_trx = 0

the operation within the transaction

uint16_t virtual_op = 0

any virtual operations implied by operation in block

struct operation_validator

Used to validate operations in a polymorphic manner.

class override_transfer_operation : public graphene::chain::base_operation
#include <transfer.hpp>

Allows the issuer of an asset to transfer an asset from any account to any account if they have override_authority.


amount.asset_id->issuer == issuer


issuer != from because this is pointless, use a normal transfer operation

Public Members

account_id_type from

Account to transfer asset from.

account_id_type to

Account to transfer asset to.

asset amount

The amount of asset to transfer from from to to.

optional<memo_data> memo

User provided data encrypted to the memo key of the “to” account.

struct price
#include <asset.hpp>

The price struct stores asset prices in the Graphene system.

A price is defined as a ratio between two assets, and represents a possible exchange rate between those two assets. prices are generally not stored in any simplified form, i.e. a price of (1000 CORE)/(20 USD) is perfectly normal.

The assets within a price are labeled base and quote. Throughout the Graphene code base, the convention used is that the base asset is the asset being sold, and the quote asset is the asset being purchased, where the price is represented as base/quote, so in the example price above the seller is looking to sell CORE asset and get USD in return.

Public Static Functions

price call_price(const asset &debt, const asset &collateral, uint16_t collateral_ratio)

The black swan price is defined as debt/collateral, we want to perform a margin call before debt == collateral. Given a debt/collateral ratio of 1 USD / CORE and a maintenance collateral requirement of 2x we can define the call price to be 2 USD / CORE.

This method divides the collateral by the maintenance collateral ratio to derive a call price for the given black swan ratio.

There exists some cases where the debt and collateral values are so small that dividing by the collateral ratio will result in a 0 price or really poor rounding errors. No matter what the collateral part of the price ratio can never go to 0 and the debt can never go more than GRAPHENE_MAX_SHARE_SUPPLY


static price unit_price(asset_id_type a = asset_id_type())

The unit price for an asset type A is defined to be a price such that for any asset m, m*A=m.

class price_feed
#include <asset.hpp>

defines market parameters for margin positions

Unnamed Group

price settlement_price

Required maintenance collateral is defined as a fixed point number with a maximum value of 10.000 and a minimum value of 1.000. (denominated in GRAPHENE_COLLATERAL_RATIO_DENOM)

A black swan event occurs when value_of_collateral equals value_of_debt, to avoid a black swan a margin call is executed when value_of_debt * required_maintenance_collateral equals value_of_collateral using rate.

Default requirement is $1.75 of collateral per $1 of debt

BlackSwan > SQR > MCR -> SP Forced settlements will evaluate using this price, defined as BITASSET / COLLATERAL

price core_exchange_rate

Price at which automatically exchanging this asset for CORE from fee pool occurs (used for paying fees)

uint16_t maintenance_collateral_ratio = GRAPHENE_DEFAULT_MAINTENANCE_COLLATERAL_RATIO

Fixed point between 1.000 and 10.000, implied fixed point denominator is GRAPHENE_COLLATERAL_RATIO_DENOM

uint16_t maximum_short_squeeze_ratio = GRAPHENE_DEFAULT_MAX_SHORT_SQUEEZE_RATIO

Fixed point between 1.000 and 10.000, implied fixed point denominator is GRAPHENE_COLLATERAL_RATIO_DENOM

price max_short_squeeze_price() const

When updating a call order the following condition must be maintained:

debt * maintenance_price() < collateral debt * settlement_price < debt * maintenance debt * maintenance_price() < debt * max_short_squeeze_price() price maintenance_price()const;When selling collateral to pay off debt, the least amount of debt to receive should be min_usd = max_short_squeeze_price() * collateral

This is provided to ensure that a black swan cannot be trigged due to poor liquidity alone, it must be confirmed by having the max_short_squeeze_price() move below the black swan price.

struct processed_transaction : public graphene::chain::signed_transaction
#include <transaction.hpp>

captures the result of evaluating the operations contained in the transaction

When processing a transaction some operations generate new object IDs and these IDs cannot be known until the transaction is actually included into a block. When a block is produced these new ids are captured and included with every transaction. The index in operation_results should correspond to the same index in operations.

If an operation did not create any new object IDs then 0 should be returned.

struct proposal_create_operation : public graphene::chain::base_operation
#include <proposal.hpp>

The proposal_create_operation creates a transaction proposal, for use in multi-sig scenarios

Creates a transaction proposal. The operations which compose the transaction are listed in order in proposed_ops, and expiration_time specifies the time by which the proposal must be accepted or it will fail permanently. The expiration_time cannot be farther in the future than the maximum expiration time set in the global properties object.

Public Static Functions

proposal_create_operation committee_proposal(const chain_parameters &param, fc::time_point_sec head_block_time)

Constructs a proposal_create_operation suitable for committee proposals, with expiration time and review period set appropriately. No proposed_ops are added. When used to create a proposal to change chain parameters, this method expects to receive the currently effective parameters, not the proposed parameters. (The proposed parameters will go in proposed_ops, and proposed_ops is untouched by this function.)

struct proposal_delete_operation : public graphene::chain::base_operation
#include <proposal.hpp>

The proposal_delete_operation deletes an existing transaction proposal

This operation allows the early veto of a proposed transaction. It may be used by any account which is a required authority on the proposed transaction, when that account’s holder feels the proposal is ill-advised and he decides he will never approve of it and wishes to put an end to all discussion of the issue. Because he is a required authority, he could simply refuse to add his approval, but this would leave the topic open for debate until the proposal expires. Using this operation, he can prevent any further breath from being wasted on such an absurd proposal.

class proposal_object : public graphene::db::abstract_object<proposal_object>
#include <proposal_object.hpp>

tracks the approval of a partially approved transaction

struct proposal_update_operation : public graphene::chain::base_operation
#include <proposal.hpp>

The proposal_update_operation updates an existing transaction proposal

This operation allows accounts to add or revoke approval of a proposed transaction. Signatures sufficient to satisfy the authority of each account in approvals are required on the transaction containing this operation.

If an account with a multi-signature authority is listed in approvals_to_add or approvals_to_remove, either all required signatures to satisfy that account’s authority must be provided in the transaction containing this operation, or a secondary proposal must be created which contains this operation.

NOTE: If the proposal requires only an account’s active authority, the account must not update adding its owner authority’s approval. This is considered an error. An owner approval may only be added if the proposal requires the owner’s authority.

If an account’s owner and active authority are both required, only the owner authority may approve. An attempt to add or remove active authority approval to such a proposal will fail.

struct pts_address
#include <pts_address.hpp>

Implements address stringification and validation from PTS

Public Functions


constructs empty / null address

pts_address(const std::string &base58str)

converts to binary, validates checksum

pts_address(const fc::ecc::public_key &pub, bool compressed = true, uint8_t version = 56)

converts to binary

bool is_valid() const

Checks the address to verify it has a valid checksum

operator std::string() const

converts to base58 + checksum

Public Members

fc::array<char, 25> addr

binary representation of address

struct refund_worker_type
#include <worker_object.hpp>

A worker who returns all of his pay to the reserve.

This worker type pays everything he receives back to the network’s reserve funds pool.

Public Members

share_type total_burned

Record of how much this worker has burned in his lifetime.

class required_approval_index : public secondary_index
#include <proposal_object.hpp>

tracks all of the proposal objects that requrie approval of an individual account.

This is a secondary index on the proposal_index


the set of required approvals is constant

struct sign_state

Public Functions

bool signed_by(const public_key_type &k)

returns true if we have a signature for this key or can produce a signature for this key, else returns false.

bool check_authority(const authority *au, uint32_t depth = 0)

Checks to see if we have signatures of the active authorites of the accounts specified in authority or the keys specified.

struct signed_block : public graphene::chain::signed_block_header
#include <block.hpp>

Subclassed by graphene::wallet::signed_block_with_info

struct signed_block_header : public graphene::chain::block_header
#include <block.hpp>

Subclassed by graphene::chain::signed_block

struct signed_transaction : public graphene::chain::transaction
#include <transaction.hpp>

adds a signature to a transaction

Subclassed by graphene::chain::processed_transaction

Public Functions

const signature_type &sign(const private_key_type &key, const chain_id_type &chain_id)

signs and appends to signatures

signature_type sign(const private_key_type &key, const chain_id_type &chain_id) const

returns signature but does not append

set<public_key_type> get_required_signatures(const chain_id_type &chain_id, const flat_set<public_key_type> &available_keys, const std::function<const authority *(account_id_type)> &get_active, const std::function<const authority *(account_id_type)> &get_owner, uint32_t max_recursion = GRAPHENE_MAX_SIG_CHECK_DEPTH, ) const

The purpose of this method is to identify some subset of available_keys that will produce sufficient signatures for a transaction. The result is not always a minimal set of signatures, but any non-minimal result will still pass validation.

set<public_key_type> minimize_required_signatures(const chain_id_type &chain_id, const flat_set<public_key_type> &available_keys, const std::function<const authority *(account_id_type)> &get_active, const std::function<const authority *(account_id_type)> &get_owner, uint32_t max_recursion = GRAPHENE_MAX_SIG_CHECK_DEPTH, ) const

This is a slower replacement for get_required_signatures() which returns a minimal set in all cases, including some cases where get_required_signatures() returns a non-minimal set.

const flat_set<public_key_type> &get_signature_keys(const chain_id_type &chain_id) const

Extract public keys from signatures with given chain ID.


Public keys


If signees is empty, E.G. when it’s the first time calling this function for the signed transaction, public keys will be extracted with given chain ID, and be stored into the mutable signees field, then signees will be returned; otherwise, the chain_id parameter will be ignored, and signees will be returned directly.

  • chain_id: A chain ID

void clear()

Removes all operations, signatures and signees.

void clear_signatures()

Removes all signatures and signees.

Public Members

vector<signature_type> signatures


flat_set<public_key_type> signees

Public keys extracted from signatures

class special_authority_object : public graphene::db::abstract_object<special_authority_object>
#include <special_authority_object.hpp>

special_authority_object only exists to help with a specific indexing problem. We want to be able to iterate over all accounts that contain a special authority. However, accounts which have a special_authority are very rare. So rather than indexing account_object by the special_authority fields (requiring additional bookkeeping for every account), we instead maintain a special_authority_object pointing to each account which has special_authority (requiring additional bookkeeping only for every account which has special_authority).

This class is an implementation detail.

struct stealth_confirmation
#include <confidential.hpp>

When sending a stealth tranfer we assume users are unable to scan the full blockchain; therefore, payments require confirmation data to be passed out of band. We assume this out-of-band channel is not secure and therefore the contents of the confirmation must be encrypted.

Public Functions

operator string() const

Packs *this then encodes as base58 encoded string.

stealth_confirmation(const std::string &base58)

Unpacks from a base58 string

struct transaction
#include <transaction.hpp>

groups operations that should be applied atomically

Subclassed by graphene::chain::signed_transaction

Public Functions

digest_type digest() const

Calculate the digest for a transaction.

digest_type sig_digest(const chain_id_type &chain_id) const

Calculate the digest used for signature validation.

template<typename Visitor>
vector<typename Visitor::result_type> visit(Visitor &&visitor)

visit all operations

Public Members

uint16_t ref_block_num = 0

Least significant 16 bits from the reference block number. If relative_expiration is zero, this field must be zero as well.

uint32_t ref_block_prefix = 0

The first non-block-number 32-bits of the reference block ID. Recall that block IDs have 32 bits of block number followed by the actual block hash, so this field should be set using the second 32 bits in the block_id_type

fc::time_point_sec expiration

This field specifies the absolute expiration for this transaction.

class transaction_evaluation_state
#include <transaction_evaluation_state.hpp>

Place holder for state tracked while processing a transaction. This class provides helper methods that are common to many different operations and also tracks which keys have signed the transaction

class transaction_object : public graphene::db::abstract_object<transaction_object>
#include <transaction_object.hpp>

The purpose of this object is to enable the detection of duplicate transactions. When a transaction is included in a block a transaction_object is added. At the end of block processing all transaction_objects that have expired can be removed from the index.

class transfer_from_blind_evaluator : public graphene::chain::evaluator<transfer_from_blind_evaluator>
#include <confidential_evaluator.hpp>

Public Functions

void pay_fee()

Routes the fee to where it needs to go. The default implementation routes the fee to the account_statistics_object of the fee_paying_account.

Before pay_fee() is called, the fee is computed by prepare_fee() and has been moved out of the fee_paying_account and (if paid in a non-CORE asset) converted by the asset’s fee pool.

Therefore, when pay_fee() is called, the fee only exists in this->core_fee_paid. So pay_fee() need only increment the receiving balance.

The default implementation simply calls account_statistics_object->pay_fee() to increment pending_fees or pending_vested_fees.

struct transfer_from_blind_operation : public graphene::chain::base_operation
#include <confidential.hpp>

Converts blinded/stealth balance to a public account balance.

struct fee_parameters_type
#include <confidential.hpp>

Public Members


the cost to register the cheapest non-free account

struct transfer_operation : public graphene::chain::base_operation
#include <transfer.hpp>

Transfers an amount of one asset from one account to another.

Fees are paid by the “from” account


amount.amount > 0


fee.amount >= 0


from != to


from account’s balance will be reduced by fee and amount


to account’s balance will be increased by amount



Public Members

account_id_type from

Account to transfer asset from.

account_id_type to

Account to transfer asset to.

asset amount

The amount of asset to transfer from from to to.

optional<memo_data> memo

User provided data encrypted to the memo key of the “to” account.

class transfer_to_blind_evaluator : public graphene::chain::evaluator<transfer_to_blind_evaluator>
#include <confidential_evaluator.hpp>

Public Functions

void pay_fee()

Routes the fee to where it needs to go. The default implementation routes the fee to the account_statistics_object of the fee_paying_account.

Before pay_fee() is called, the fee is computed by prepare_fee() and has been moved out of the fee_paying_account and (if paid in a non-CORE asset) converted by the asset’s fee pool.

Therefore, when pay_fee() is called, the fee only exists in this->core_fee_paid. So pay_fee() need only increment the receiving balance.

The default implementation simply calls account_statistics_object->pay_fee() to increment pending_fees or pending_vested_fees.

class transfer_to_blind_operation : public graphene::chain::base_operation
#include <confidential.hpp>

Converts public account balance to a blinded or stealth balance.

struct fee_parameters_type
#include <confidential.hpp>

Public Members


the cost to register the cheapest non-free account

struct vesting_balance_create_operation : public graphene::chain::base_operation
#include <vesting.hpp>

Create a vesting balance.

The chain allows a user to create a vesting balance. Normally, vesting balances are created automatically as part of cashback and worker operations. This operation allows vesting balances to be created manually as well.

Manual creation of vesting balances can be used by a stakeholder to publicly demonstrate that they are committed to the chain. It can also be used as a building block to create transactions that function like public debt. Finally, it is useful for testing vesting balance functionality.


ID of newly created vesting_balance_object

Public Members

account_id_type creator

Who provides funds initially.

account_id_type owner

Who is able to withdraw the balance.

class vesting_balance_object : public graphene::db::abstract_object<vesting_balance_object>
#include <vesting_balance_object.hpp>

Vesting balance object is a balance that is locked by the blockchain for a period of time.

Subclassed by graphene::wallet::vesting_balance_object_with_info

Public Functions

void deposit(const fc::time_point_sec &now, const asset &amount)

Deposit amount into vesting balance, requiring it to vest before withdrawal.

void deposit_vested(const fc::time_point_sec &now, const asset &amount)

Deposit amount into vesting balance, making the new funds vest immediately.

void withdraw(const fc::time_point_sec &now, const asset &amount)

Used to remove a vesting balance from the VBO. As well as the balance field, coin_seconds_earned and coin_seconds_earned_last_update fields are updated.

The money doesn’t “go” anywhere; the caller is responsible for crediting it to the proper account.

asset get_allowed_withdraw(const time_point_sec &now) const

Get amount of allowed withdrawal.

Public Members

account_id_type owner

Account which owns and may withdraw from this vesting balance.

asset balance

Total amount remaining in this vesting balance Includes the unvested funds, and the vested funds which have not yet been withdrawn

vesting_policy policy

The vesting policy stores details on when funds vest, and controls when they may be withdrawn.

struct vesting_balance_withdraw_operation : public graphene::chain::base_operation
#include <vesting.hpp>

Withdraw from a vesting balance.

Withdrawal from a not-completely-mature vesting balance will result in paying fees.



Public Members

account_id_type owner

Must be vesting_balance.owner.

struct vesting_balance_worker_type
#include <worker_object.hpp>

A worker who sends his pay to a vesting balance.

This worker type takes all of his pay and places it into a vesting balance

Public Members

vesting_balance_id_type balance

The balance this worker pays into.

struct vote_counter
#include <vote_count.hpp>

Keep track of vote totals in internal authority object. See #533.

Public Functions

void finish(authority &out_auth)

Write into out_auth, but only if we have at least one member.

struct vote_id_type
#include <vote.hpp>

An ID for some votable object.

This class stores an ID for a votable object. The ID is comprised of two fields: a type, and an instance. The type field stores which kind of object is being voted on, and the instance stores which specific object of that type is being referenced by this ID.

A value of vote_id_type is implicitly convertible to an unsigned 32-bit integer containing only the instance. It may also be implicitly assigned from a uint32_t, which will update the instance. It may not, however, be implicitly constructed from a uint32_t, as in this case, the type would be unknown.

On the wire, a vote_id_type is represented as a 32-bit integer with the type in the lower 8 bits and the instance in the upper 24 bits. This means that types may never exceed 8 bits, and instances may never exceed 24 bits.

In JSON, a vote_id_type is represented as a string “type:instance”, i.e. “1:5” would be type 1 and instance 5.


In the Graphene protocol, vote_id_type instances are unique across types; that is to say, if an object of type 1 has instance 4, an object of type 0 may not also have instance 4. In other words, the type is not a namespace for instances; it is only an informational field.

Public Functions


Default constructor. Sets type and instance to 0.

vote_id_type(vote_type type, uint32_t instance = 0)

Construct this vote_id_type with provided type and instance.

vote_id_type(const std::string &serial)

Construct this vote_id_type from a serial string in the form “type:instance”.

void set_type(vote_type type)

Set the type of this vote_id_type.

vote_type type() const

Get the type of this vote_id_type.

void set_instance(uint32_t instance)

Set the instance of this vote_id_type.

uint32_t instance() const

Get the instance of this vote_id_type.

vote_id_type &operator=(uint32_t instance)

Set the instance of this vote_id_type.

operator uint32_t() const

Get the instance of this vote_id_type.

operator std::string() const

Convert this vote_id_type to a serial string in the form “type:instance”.

Public Members

uint32_t content

Lower 8 bits are type; upper 24 bits are instance.

struct withdraw_permission_claim_operation : public graphene::chain::base_operation
#include <withdraw_permission.hpp>

Withdraw from an account which has published a withdrawal permission

This operation is used to withdraw from an account which has authorized such a withdrawal. It may be executed at most once per withdrawal period for the given permission. On execution, amount_to_withdraw is transferred from withdraw_from_account to withdraw_to_account, assuming amount_to_withdraw is within the withdrawal limit. The withdrawal permission will be updated to note that the withdrawal for the current period has occurred, and further withdrawals will not be permitted until the next withdrawal period, assuming the permission has not expired. This operation may be executed at any time within the current withdrawal period.

Fee is paid by withdraw_to_account, which is required to authorize this operation

Public Members

asset fee

Paid by withdraw_to_account.

withdraw_permission_id_type withdraw_permission

ID of the permission authorizing this withdrawal.

account_id_type withdraw_from_account

Must match withdraw_permission->withdraw_from_account.

account_id_type withdraw_to_account

Must match withdraw_permision->authorized_account.

asset amount_to_withdraw

Amount to withdraw. Must not exceed withdraw_permission->withdrawal_limit.

optional<memo_data> memo

Memo for withdraw_from_account. Should generally be encrypted with withdraw_from_account->memo_key.

struct withdraw_permission_create_operation : public graphene::chain::base_operation
#include <withdraw_permission.hpp>

Create a new withdrawal permission

This operation creates a withdrawal permission, which allows some authorized account to withdraw from an authorizing account. This operation is primarily useful for scheduling recurring payments.

Withdrawal permissions define withdrawal periods, which is a span of time during which the authorized account may make a withdrawal. Any number of withdrawals may be made so long as the total amount withdrawn per period does not exceed the limit for any given period.

Withdrawal permissions authorize only a specific pairing, i.e. a permission only authorizes one specified authorized account to withdraw from one specified authorizing account. Withdrawals are limited and may not exceet the withdrawal limit. The withdrawal must be made in the same asset as the limit; attempts with withdraw any other asset type will be rejected.

The fee for this operation is paid by withdraw_from_account, and this account is required to authorize this operation.

Public Members

account_id_type withdraw_from_account

The account authorizing withdrawals from its balances.

account_id_type authorized_account

The account authorized to make withdrawals from withdraw_from_account.

asset withdrawal_limit

The maximum amount authorized_account is allowed to withdraw in a given withdrawal period.

uint32_t withdrawal_period_sec = 0

Length of the withdrawal period in seconds.

uint32_t periods_until_expiration = 0

The number of withdrawal periods this permission is valid for.

time_point_sec period_start_time

Time at which the first withdrawal period begins; must be in the future.

struct withdraw_permission_delete_operation : public graphene::chain::base_operation
#include <withdraw_permission.hpp>

Delete an existing withdrawal permission

This operation cancels a withdrawal permission, thus preventing any future withdrawals using that permission.

Fee is paid by withdraw_from_account, which is required to authorize this operation

Public Members

account_id_type withdraw_from_account

Must match withdrawal_permission->withdraw_from_account. This account pays the fee.

account_id_type authorized_account

The account previously authorized to make withdrawals. Must match withdrawal_permission->authorized_account.

withdraw_permission_id_type withdrawal_permission

ID of the permission to be revoked.

class withdraw_permission_object : public graphene::db::abstract_object<withdraw_permission_object>
#include <withdraw_permission_object.hpp>

Grants another account authority to withdraw a limited amount of funds per interval.

The primary purpose of this object is to enable recurring payments on the blockchain. An account which wishes to process a recurring payment may use a withdraw_permission_claim_operation to reference an object of this type and withdraw up to withdrawal_limit from withdraw_from_account. Only authorized_account may do this. Any number of withdrawals may be made so long as the total amount withdrawn per period does not exceed the limit for any given period.

Public Members

account_id_type withdraw_from_account

The account authorizing authorized_account to withdraw from it.

account_id_type authorized_account

The account authorized to make withdrawals from withdraw_from_account.

asset withdrawal_limit

The maximum amount which may be withdrawn per period. All withdrawals must be of this asset type.

uint32_t withdrawal_period_sec = 0

The duration of a withdrawal period in seconds.

time_point_sec expiration

The time at which this withdraw permission expires.

struct withdraw_permission_update_operation : public graphene::chain::base_operation
#include <withdraw_permission.hpp>

Update an existing withdraw permission

This oeration is used to update the settings for an existing withdrawal permission. The accounts to withdraw to and from may never be updated. The fields which may be updated are the withdrawal limit (both amount and asset type may be updated), the withdrawal period length, the remaining number of periods until expiration, and the starting time of the new period.

Fee is paid by withdraw_from_account, which is required to authorize this operation

Public Members

account_id_type withdraw_from_account

This account pays the fee. Must match permission_to_update->withdraw_from_account.

account_id_type authorized_account

The account authorized to make withdrawals. Must match permission_to_update->authorized_account.

withdraw_permission_id_type permission_to_update

ID of the permission which is being updated.

asset withdrawal_limit

New maximum amount the withdrawer is allowed to charge per withdrawal period.

uint32_t withdrawal_period_sec = 0

New length of the period between withdrawals.

time_point_sec period_start_time

New beginning of the next withdrawal period; must be in the future.

uint32_t periods_until_expiration = 0

The new number of withdrawal periods for which this permission will be valid.

struct witness_create_operation : public graphene::chain::base_operation
#include <witness.hpp>

Create a witness object, as a bid to hold a witness position on the network.

Accounts which wish to become witnesses may use this operation to create a witness object which stakeholders may vote on to approve its position as a witness.

Public Members

account_id_type witness_account

The account which owns the witness. This account pays the fee for this operation.

struct witness_update_operation : public graphene::chain::base_operation
#include <witness.hpp>

Update a witness object’s URL and block signing key.

Public Members

witness_id_type witness

The witness object to update.

account_id_type witness_account

The account which owns the witness. This account pays the fee for this operation.

optional<string> new_url

The new URL.

optional<public_key_type> new_signing_key

The new block signing key.

struct worker_create_operation : public graphene::chain::base_operation
#include <worker.hpp>

Create a new worker object.

Public Members

worker_initializer initializer

This should be set to the initializer appropriate for the type of worker to be created.

class worker_object : public graphene::db::abstract_object<worker_object>
#include <worker_object.hpp>

Worker object contains the details of a blockchain worker. See The Blockchain Worker System for details.

Public Members

account_id_type worker_account

ID of the account which owns this worker.

time_point_sec work_begin_date

Time at which this worker begins receiving pay, if elected.

time_point_sec work_end_date

Time at which this worker will cease to receive pay. Worker will be deleted at this time.

share_type daily_pay

Amount in CORE this worker will be paid each day.

worker_type worker

ID of this worker’s pay balance.

string name

Human-readable name for the worker.

string url

URL to a web page representing this worker.

vote_id_type vote_for

Voting ID which represents approval of this worker.

vote_id_type vote_against

Voting ID which represents disapproval of this worker.

struct worker_pay_visitor

A visitor for worker_type which calls pay_worker on the worker within.

namespace detail


template<typename T, int... Is>
void for_each(T &&t, const account_object &a, seq<Is...>)
template<typename Lambda>
void with_skip_flags(database &db, uint32_t skip_flags, Lambda callback)

Set the skip_flags to the given value, call callback, then reset skip_flags to their previous value after callback is done.

template<typename Lambda>
void without_pending_transactions(database &db, std::vector<processed_transaction> &&pending_transactions, Lambda callback)

Empty pending_transactions, call callback, then reset pending_transactions after callback is done.

Pending transactions which no longer validate will be culled.

bool _is_authorized_asset(const database &d, const account_object &acct, const asset_object &asset_obj)
struct pending_transactions_restorer
#include <db_with.hpp>

Class used to help the without_pending_transactions implementation.

TODO: Change the name of this class to better reflect the fact that it restores popped transactions as well as pending transactions.

struct skip_flags_restorer
#include <db_with.hpp>

Class used to help the with_skip_flags implementation. It must be defined in this header because it must be available to the with_skip_flags implementation, which is a template and therefore must also be defined in this header.