19 #include <scorum/rewards_math/curve.hpp>
20 #include <scorum/rewards_math/formulas.hpp>
22 #include <boost/range/adaptor/reversed.hpp>
27 namespace database_ns {
29 using scorum::rewards_math::shares_vector_type;
54 const auto& rf = fund_service.get();
58 fc::uint128_t total_claims = rewards_math::calculate_decreasing_total_claims(
59 rf.recent_claims, now, rf.last_update, SCORUM_RECENT_RSHARES_DECAY_RATE);
61 fund_service.update([&](fund_object_type& rfo) {
62 rfo.recent_claims = total_claims;
63 rfo.last_update = now;
74 const asset& publication_reward,
75 const asset& parent_payout_value);
81 const asset& reward_fund_balance,
82 fc::uint128_t total_claims,
88 curators_author_rewards pay_curators(
const comment_object& comment,
const asset& fund_reward);
89 asset pay_beneficiaries(
const comment_object& comment,
const asset& author_reward);
91 void pay_account(
const account_object& recipient,
const asset&
reward);
93 template <
class CommentStatisticService>
94 void accumulate_comment_statistic(CommentStatisticService& stat_service,
95 const comment_object& comment,
96 const asset& fund_reward,
97 const asset& total_payout,
98 const asset& author_payout,
99 const asset& curation_payout,
100 const asset& payout_from_children,
101 const asset& payout_to_parent,
102 const asset& beneficiary_payout)
106 const auto& stat = stat_service.get(comment.id);
108 c.fund_reward_value += fund_reward;
109 c.total_payout_value += total_payout;
110 c.author_payout_value += author_payout;
111 c.curator_payout_value += curation_payout;
112 c.beneficiary_payout_value += beneficiary_payout;
113 c.from_children_payout_value += payout_from_children;
114 c.to_parent_payout_value += payout_to_parent;
118 void accumulate_statistic(
const comment_object& comment,
119 const account_object& author,
120 const asset& fund_reward,
121 const asset& author_payout,
122 const asset& curation_payout,
123 const asset& payout_from_children,
124 const asset& payout_to_parent,
125 const asset& beneficiary_payout,
128 void accumulate_statistic(
const account_object& voter,
const asset& curation_payout);
132 fc::shared_string get_permlink(
const fc::shared_string& str)
const;
135 block_task_context& _ctx;
136 dynamic_global_property_service_i& dgp_service;
137 account_service_i& account_service;
138 account_blogging_statistic_service_i& account_blogging_statistic_service;
139 comment_service_i& comment_service;
140 comment_statistic_scr_service_i& comment_statistic_scr_service;
141 comment_statistic_sp_service_i& comment_statistic_sp_service;
142 comment_vote_service_i& comment_vote_service;
143 hardfork_property_service_i& hardfork_service;
scorum::chain::comment_service_i::comment_refs_type comment_refs_type
uint64_t asset_symbol_type
virtual fc::time_point_sec head_block_time() const =0