BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Go to the documentation of this file.
31 #include <graphene/chain/hardfork.hpp>
36 namespace graphene {
namespace chain {
43 FC_ASSERT( HARDFORK_CORE_2351_PASSED(block_time),
"Not allowed until the core-2351 hardfork" );
46 "The account is unauthorized by the asset" );
64 return new_samet_fund_object.
id;
107 "Can only update the balance of a SameT Fund when the unpaid amount is zero" );
113 "The account is unauthorized by the asset" );
124 "New fee rate should not be the same as the original fee rate" );
159 "Insufficient balance in the SameT Fund thus unable to borrow" );
162 "The account is unauthorized by the asset" );
195 "The account is unauthorized by the asset" );
198 "Repay amount should not be greater than unpaid amount" );
205 "Insuffient fund fee, requires ${r}, offered ${p}",
object_id_type do_apply(const samet_fund_create_operation &op) const
optional< uint32_t > new_fee_rate
New fee rate, optional.
void_result do_evaluate(const samet_fund_update_operation &op)
#define FC_CAPTURE_AND_RETHROW(...)
samet_fund_id_type fund_id
ID of the SameT Fund.
const samet_fund_object * _fund
tracks the blockchain state in an extensible manner
uint32_t fee_rate
Fee rate, the demominator is GRAPHENE_FEE_RATE_DENOM.
Delete a SameT Fund object.
samet_fund_id_type fund_id
ID of the SameT Fund object.
time_point_sec head_block_time() const
const samet_fund_object * _fund
A SameT Fund is a fund which can be used by a borrower and have to be repaid in the same transaction.
share_type balance
Usable amount in the fund.
const T & create(F &&constructor)
void adjust_balance(account_id_type account, asset delta)
Adjust a particular account's balance in a given asset by a delta.
optional< asset > delta_amount
Delta amount, optional.
void_result do_evaluate(const samet_fund_delete_operation &op)
extendable_operation_result do_apply(const samet_fund_borrow_operation &op) const
account_id_type borrower
The account who borrows from the fund.
share_type unpaid_amount
Unpaid amount.
extendable_operation_result do_apply(const samet_fund_repay_operation &op) const
Borrow from a SameT Fund.
Create a new SameT Fund object.
Update a SameT Fund object.
asset do_apply(const samet_fund_delete_operation &op) const
account_id_type owner_account
Owner of the fund.
samet_fund_id_type fund_id
ID of the SameT Fund.
uint32_t fee_rate
Fee rate, the demominator is GRAPHENE_FEE_RATE_DENOM.
account_id_type account
The account who repays to the SameT Fund.
void_result do_apply(const samet_fund_update_operation &op) const
void_result do_evaluate(const samet_fund_repay_operation &op)
bool is_authorized_asset(const database &d, const account_object &acct, const asset_object &asset_obj)
constexpr uint32_t GRAPHENE_FEE_RATE_DENOM
Denominator for SameT Fund fee calculation.
const samet_fund_object * _fund
asset repay_amount
The amount to repay.
const samet_fund_object * _fund
share_type balance
Usable amount in the fund.
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
asset fund_fee
Fee for using the fund.
asset_id_type asset_type
Asset type in the fund.
account_id_type owner_account
Owner of the fund.
void_result do_evaluate(const samet_fund_borrow_operation &op)
asset_id_type asset_type
Asset type in the fund.
account_id_type owner_account
The account who owns the SameT Fund object.
void_result do_evaluate(const samet_fund_create_operation &op) const
const account_object * fee_paying_account
account_id_type owner_account
Owner of the fund.
void remove(const object &obj)
asset borrow_amount
The amount to borrow.
samet_fund_id_type fund_id
ID of the SameT Fund object.
void modify(const T &obj, const Lambda &m)