BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Public Member Functions | Public Attributes | List of all members
graphene::chain::cdd_vesting_policy Struct Reference

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

#include <vesting_balance_object.hpp>

Public Member Functions

fc::uint128_t compute_coin_seconds_earned (const vesting_policy_context &ctx) const
 
void update_coin_seconds_earned (const vesting_policy_context &ctx)
 
asset get_allowed_withdraw (const vesting_policy_context &ctx) const
 
bool is_deposit_allowed (const vesting_policy_context &ctx) const
 
bool is_deposit_vested_allowed (const vesting_policy_context &ctx) const
 
bool is_withdraw_allowed (const vesting_policy_context &ctx) const
 
void on_deposit (const vesting_policy_context &ctx)
 
void on_deposit_vested (const vesting_policy_context &ctx)
 
void on_withdraw (const vesting_policy_context &ctx)
 

Public Attributes

uint32_t vesting_seconds = 0
 
fc::uint128_t coin_seconds_earned
 
fc::time_point_sec start_claim
 
fc::time_point_sec coin_seconds_earned_last_update
 

Detailed Description

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.

Definition at line 89 of file vesting_balance_object.hpp.

Member Function Documentation

◆ compute_coin_seconds_earned()

fc::uint128_t graphene::chain::cdd_vesting_policy::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.

Definition at line 93 of file vesting_balance_object.cpp.

◆ get_allowed_withdraw()

asset graphene::chain::cdd_vesting_policy::get_allowed_withdraw ( const vesting_policy_context ctx) const

Definition at line 114 of file vesting_balance_object.cpp.

◆ is_deposit_allowed()

bool graphene::chain::cdd_vesting_policy::is_deposit_allowed ( const vesting_policy_context ctx) const

Definition at line 147 of file vesting_balance_object.cpp.

◆ is_deposit_vested_allowed()

bool graphene::chain::cdd_vesting_policy::is_deposit_vested_allowed ( const vesting_policy_context ctx) const

Definition at line 153 of file vesting_balance_object.cpp.

◆ is_withdraw_allowed()

bool graphene::chain::cdd_vesting_policy::is_withdraw_allowed ( const vesting_policy_context ctx) const

Definition at line 158 of file vesting_balance_object.cpp.

◆ on_deposit()

void graphene::chain::cdd_vesting_policy::on_deposit ( const vesting_policy_context ctx)

Definition at line 124 of file vesting_balance_object.cpp.

◆ on_deposit_vested()

void graphene::chain::cdd_vesting_policy::on_deposit_vested ( const vesting_policy_context ctx)

Definition at line 129 of file vesting_balance_object.cpp.

◆ on_withdraw()

void graphene::chain::cdd_vesting_policy::on_withdraw ( const vesting_policy_context ctx)

Definition at line 135 of file vesting_balance_object.cpp.

◆ update_coin_seconds_earned()

void graphene::chain::cdd_vesting_policy::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().

Definition at line 108 of file vesting_balance_object.cpp.

Member Data Documentation

◆ coin_seconds_earned

fc::uint128_t graphene::chain::cdd_vesting_policy::coin_seconds_earned

Definition at line 92 of file vesting_balance_object.hpp.

◆ coin_seconds_earned_last_update

fc::time_point_sec graphene::chain::cdd_vesting_policy::coin_seconds_earned_last_update

Definition at line 95 of file vesting_balance_object.hpp.

◆ start_claim

fc::time_point_sec graphene::chain::cdd_vesting_policy::start_claim

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

Definition at line 94 of file vesting_balance_object.hpp.

◆ vesting_seconds

uint32_t graphene::chain::cdd_vesting_policy::vesting_seconds = 0

Definition at line 91 of file vesting_balance_object.hpp.


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