29 #include <boost/multi_index/composite_key.hpp> 30 #include <boost/multi_index/hashed_index.hpp> 31 #include <boost/multi_index/identity.hpp> 36 namespace graphene {
namespace chain {
46 : balance(_balance), now(_now), amount(_amount) {}
66 uint32_t vesting_cliff_seconds = 0;
68 uint32_t vesting_duration_seconds = 0;
78 {
FC_THROW(
"May not deposit vested into a linear vesting balance." ); }
91 uint32_t vesting_seconds = 0;
155 static constexpr uint8_t type_id = vesting_balance_object_type;
198 struct by_vesting_type;
206 inline uint64_t
vbo_mfs_hash(
const account_id_type& account_id,
const asset_id_type& asset_id)
208 return (asset_id.instance.value << 40) ^ account_id.instance.value;
226 return hash_value(vbo.
id);
249 return ( lhs.
id == rhs.
id );
254 typedef multi_index_container<
257 ordered_unique< tag<by_id>, member< object, object_id_type, &object::id >
259 ordered_non_unique< tag<by_account>,
260 member<vesting_balance_object, account_id_type, &vesting_balance_object::owner>
262 hashed_unique< tag<by_vesting_type>,
263 identity<vesting_balance_object>,
280 (vesting_cliff_seconds)
281 (vesting_duration_seconds)
288 (coin_seconds_earned)
289 (coin_seconds_earned_last_update)
generic_index< vesting_balance_object, vesting_balance_multi_index_type > vesting_balance_index
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 > >, hashed_unique< tag< by_vesting_type >, identity< vesting_balance_object >, detail::vesting_balance_object_hash, detail::vesting_balance_object_equal > > > vesting_balance_multi_index_type
fc::time_point_sec begin_timestamp
This is the time at which funds begin vesting.
vesting_balance_type balance_type
type of the vesting balance
fc::static_variant< linear_vesting_policy, cdd_vesting_policy, instant_vesting_policy > vesting_policy
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
#define MAP_OBJECT_ID_TO_TYPE(OBJECT)
uint64_t operator()(const vesting_balance_object &vbo) const
fc::time_point_sec start_claim
vesting_policy policy
The vesting policy stores details on when funds vest, and controls when they may be withdrawn...
FC_REFLECT_TYPENAME(fc::log_message)
FC_REFLECT_ENUM(graphene::net::core_message_type_enum,(trx_message_type)(block_message_type)(core_message_type_first)(item_ids_inventory_message_type)(blockchain_item_ids_inventory_message_type)(fetch_blockchain_item_ids_message_type)(fetch_items_message_type)(item_not_available_message_type)(hello_message_type)(connection_accepted_message_type)(connection_rejected_message_type)(address_request_message_type)(address_message_type)(closing_connection_message_type)(current_time_request_message_type)(current_time_reply_message_type)(check_firewall_message_type)(check_firewall_reply_message_type)(get_current_connections_request_message_type)(get_current_connections_reply_message_type)(core_message_type_last))(different_chain)(already_connected)(connected_to_self)(not_accepting_connections)(blocked)(invalid_hello_message)(client_too_old))(inbound)(outbound))(firewalled)(not_firewalled))(unable_to_connect)(connection_successful)) namespace std
#define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type)
fc::uint128_t coin_seconds_earned
share_type begin_balance
The total amount of asset to vest.
#define FC_REFLECT_EMPTY(TYPE)
bool is_deposit_vested_allowed(const vesting_policy_context &) const
Use the Curiously Recurring Template Pattern to automatically add the ability to clone, serialize, and move objects polymorphically.
uint64_t vbo_mfs_hash(const account_id_type &account_id, const asset_id_type &asset_id)
void on_deposit_vested(const vesting_policy_context &)
bool is_deposit_vested_allowed(const vesting_policy_context &) const
#define FC_REFLECT_DERIVED(TYPE, INHERITS, MEMBERS)
Specializes fc::reflector for TYPE where type inherits other reflected classes.
defines vesting in terms of coin-days accrued which allows for dynamic deposit/withdraw ...
fc::time_point_sec coin_seconds_earned_last_update
Linear vesting balance with cliff.
account_id_type owner
Account which owns and may withdraw from this vesting balance.
vesting_policy_context(asset _balance, fc::time_point_sec _now, asset _amount)