Scorum
scorum_virtual_operations.hpp
Go to the documentation of this file.
1 #pragma once
7 
8 #include <fc/utf8.hpp>
9 
10 namespace scorum {
11 namespace protocol {
12 
14 {
16  {
17  }
18  author_reward_operation(const account_name_type& a, const std::string& p, const asset& reward_)
19  : author(a)
20  , permlink(p)
21  , reward(reward_)
22  {
23  }
24 
26  std::string permlink;
27 
29  asset reward; // in SCR or SP
30 };
31 
33 {
35  {
36  }
37  curation_reward_operation(const std::string& c, const asset& r, const std::string& a, const std::string& p)
38  : curator(c)
39  , reward(r)
40  , comment_author(a)
41  , comment_permlink(p)
42  {
43  }
44 
46  asset reward; // in SCR or SP
48  std::string comment_permlink;
49 };
50 
52 {
54  {
55  }
57  const std::string& pl,
58  const asset& fund_reward,
59  const asset& total_payout,
60  const asset& author_payout,
61  const asset& curators_payout,
63  const asset& to_parent_payout,
65  : author(a)
66  , permlink(pl)
74  {
75  }
76 
78  std::string permlink;
79 
82 
85 
88 
91 
94 
97 
100 };
101 
103 {
106  : from_account(f)
107  {
108  }
109 
111 };
112 
114 {
116 };
117 
119 {
121  acc_to_acc_vesting_withdraw_operation(const std::string& f, const std::string& t, const asset& w)
122  : from_account(f)
123  , to_account(t)
124  , withdrawn(w)
125  {
126  }
127 
131 };
132 
134 {
136  devpool_to_acc_vesting_withdraw_operation(const std::string& t, const asset& w)
137  : to_account(t)
138  , withdrawn(w)
139  {
140  }
141 
144 };
145 
147 {
149  acc_to_devpool_vesting_withdraw_operation(const std::string& f, const asset& w)
150  : from_account(f)
151  , withdrawn(w)
152  {
153  }
154 
157 };
158 
160 {
163  : withdrawn(w)
164  {
165  }
166 
168 };
169 
171 {
173  {
174  }
175  shutdown_witness_operation(const std::string& o)
176  : owner(o)
177  {
178  }
179 
181 };
182 
184 {
186  {
187  }
188  witness_miss_block_operation(const std::string& o, uint32_t num)
189  : owner(o)
190  , block_num(num)
191  {
192  }
193 
195  uint32_t block_num = 0;
196 };
197 
199 {
201  {
202  }
203  hardfork_operation(uint32_t hf_id)
204  : hardfork_id(hf_id)
205  {
206  }
207 
208  uint32_t hardfork_id = 0;
209 };
210 
212 {
214  {
215  }
216  comment_payout_update_operation(const account_name_type& a, const std::string& p)
217  : author(a)
218  , permlink(p)
219  {
220  }
221 
223  std::string permlink;
224 };
225 
227 {
229  {
230  }
232  : account(a)
233  , scorumpower(v)
234  {
235  }
236 
239 };
240 
242 {
244  {
245  }
247  const account_name_type& a,
248  const std::string& p,
249  const asset& r)
250  : benefactor(b)
251  , author(a)
252  , permlink(p)
253  , reward(r)
254  {
255  }
256 
259  std::string permlink;
260  asset reward; // in SCR or SP
261 };
262 
264 {
266  {
267  }
268  producer_reward_operation(const std::string& p, const asset& v)
269  : producer(p)
270  , reward(v)
271  {
272  }
273 
275  asset reward; // in SCR or SP
276 };
277 
279 {
281  {
282  }
283  active_sp_holders_reward_operation(const std::string& h, const asset& v)
284  : sp_holder(h)
285  , reward(v)
286  {
287  }
288 
290  asset reward; // in SCR or SP
291 };
292 
294 {
296 
297  using rewarded_type = fc::flat_map<account_name_type, asset>;
298 
300  : rewarded(rewarded_)
301  {
302  }
303 
306 };
307 
309 {
311  {
312  }
313  expired_contract_refund_operation(const std::string& o, const asset& v)
314  : owner(o)
315  , refund(v)
316  {
317  }
318 
321 };
322 
324 {
327  : proposal_op(op)
328  {
329  }
330 
332 };
333 
335 {
337  {
338  }
340  const account_name_type& owner_,
341  const int64_t id_,
342  const asset& cash_)
343  : type(type_)
344  , owner(owner_)
345  , id(id_)
346  , cash(cash_)
347  {
348  FC_ASSERT(cash.symbol() == SCORUM_SYMBOL);
349  }
350 
353  int64_t id = -1;
355 };
356 
358 {
360  {
361  }
363  const account_name_type& owner_,
364  const int64_t id_,
365  const asset& cash_)
366  : type(type_)
367  , owner(owner_)
368  , id(id_)
369  , cash(cash_)
370  {
371  FC_ASSERT(cash.symbol() == SCORUM_SYMBOL);
372  }
373 
376  int64_t id = -1;
378 };
379 
381 {
383  {
384  }
386  : type(type)
387  , owner(owner)
388  , id(id)
389  {
390  }
391 
394  int64_t id = -1;
395 };
396 
398 {
406  int64_t matched_bet_id)
407  : better1(better1)
408  , better2(better2)
414  {
415  }
416 
423  int64_t matched_bet_id = -1;
424 };
425 
427 {
428  // TODO: could be removed in C++17
434  {
435  }
436 
440 };
441 
442 enum class bet_resolve_kind : uint8_t
443 {
444  win,
445  draw
446 };
447 
449 {
450  // TODO: could be removed in C++17
453  const account_name_type& better,
454  const uuid_type& bet_uuid,
455  const asset& income,
458  , better(better)
459  , bet_uuid(bet_uuid)
460  , income(income)
461  , kind(kind)
462  {
463  }
464 
470 };
471 
472 enum class bet_kind : uint8_t
473 {
474  pending,
475  matched
476 };
477 
479 {
480  // TODO: could be removed in C++17
483  const account_name_type& better,
484  const uuid_type& bet_uuid,
485  const asset& stake,
486  bet_kind kind)
488  , better(better)
489  , bet_uuid(bet_uuid)
490  , stake(stake)
491  , kind(kind)
492  {
493  }
494 
500 };
501 
503 {
504  // TODO: could be removed in C++17
507  const account_name_type& better,
508  const uuid_type& bet_uuid,
509  const asset& stake)
511  , better(better)
512  , bet_uuid(bet_uuid)
513  , stake(stake)
514  {
515  }
516 
521 };
522 
524 {
525  // TODO: could be removed in C++17
528  const account_name_type& better,
529  const uuid_type& bet_uuid,
530  const asset& old_stake,
531  const asset& new_stake)
533  , better(better)
534  , bet_uuid(bet_uuid)
537  {
538  }
539 
545 };
546 }
547 } // scorum::protocol
548 
549 // clang-format off
551  (author)
552  (permlink)
553  (reward))
555  (curator)
556  (reward)
557  (comment_author)
558  (comment_permlink))
560  (author)
561  (permlink)
562  (fund_reward)
563  (total_payout)
564  (author_payout)
565  (curators_payout)
566  (from_children_payout)
567  (to_parent_payout)
568  (beneficiaries_payout))
570  (owner))
572  (owner)
573  (block_num))
575  (hardfork_id))
577  (author)
578  (permlink))
580  (account)
581  (scorumpower))
583  (benefactor)
584  (author)
585  (permlink)
586  (reward))
588  (producer)
589  (reward))
591  (sp_holder)
592  (reward))
594  (rewarded))
596  (owner)
597  (refund))
599  (from_account))
602  (from_account)
603  (to_account)
604  (withdrawn))
606  (to_account)
607  (withdrawn))
609  (from_account)
610  (withdrawn))
612  (withdrawn))
614  (proposal_op))
616  (type)
617  (owner)
618  (id)
619  (cash))
621  (type)
622  (owner)
623  (id)
624  (cash))
626  (type)
627  (owner)
628  (id))
630  (game_uuid)
631  (old_status)
632  (new_status))
634  (win)
635  (draw))
637  (game_uuid)
638  (better)
639  (bet_uuid)
640  (income)
641  (kind))
643  (pending)
644  (matched))
646  (game_uuid)
647  (better)
648  (bet_uuid)
649  (stake)
650  (kind))
652  (game_uuid)
653  (better)
654  (bet_uuid)
655  (stake))
657  (game_uuid)
658  (better)
659  (bet_uuid)
660  (old_stake)
661  (new_stake))
662 FC_REFLECT(scorum::protocol::bets_matched_operation, (better1)(better2)(bet1_uuid)
663  (bet2_uuid)
664  (matched_stake1)
665  (matched_stake2)
666  (matched_bet_id))
667 // clang-format on
#define SP_SYMBOL
Definition: config.hpp:104
#define SCORUM_SYMBOL
Definition: config.hpp:102
FC_REFLECT_ENUM(scorum::protocol::game_status,(created)(started)(finished)(resolved)(expired)(cancelled)) namespace fc
Definition: game_status.hpp:18
FC_REFLECT(appender_args,(appender)(stream)) FC_REFLECT_DERIVED(file_appender_args
fc::fixed_string_16 account_name_type
Definition: types.hpp:62
fc::static_variant< registration_committee_add_member_operation, registration_committee_exclude_member_operation, registration_committee_change_quorum_operation, development_committee_add_member_operation, development_committee_exclude_member_operation, development_committee_change_quorum_operation, development_committee_withdraw_vesting_operation, development_committee_transfer_operation, development_committee_empower_advertising_moderator_operation, development_committee_change_post_budgets_auction_properties_operation, development_committee_change_banner_budgets_auction_properties_operation, development_committee_empower_betting_moderator_operation, development_committee_change_betting_resolve_delay_operation > proposal_operation
Definition: asset.cpp:15
boost::uuids::uuid uuid_type
Definition: types.hpp:53
acc_to_acc_vesting_withdraw_operation(const std::string &f, const std::string &t, const asset &w)
acc_to_devpool_vesting_withdraw_operation(const std::string &f, const asset &w)
active_sp_holders_reward_operation(const std::string &h, const asset &v)
asset_symbol_type symbol() const
Definition: asset.hpp:32
asset reward
all reward for comment author (with from_children_payout)
author_reward_operation(const account_name_type &a, const std::string &p, const asset &reward_)
bet_cancelled_operation(const uuid_type &game_uuid, const account_name_type &better, const uuid_type &bet_uuid, const asset &stake, bet_kind kind)
bet_resolved_operation(const uuid_type &game_uuid, const account_name_type &better, const uuid_type &bet_uuid, const asset &income, bet_resolve_kind kind)
bet_restored_operation(const uuid_type &game_uuid, const account_name_type &better, const uuid_type &bet_uuid, const asset &stake)
bet_updated_operation(const uuid_type &game_uuid, const account_name_type &better, const uuid_type &bet_uuid, const asset &old_stake, const asset &new_stake)
bets_matched_operation(account_name_type better1, account_name_type better2, uuid_type bet1_uuid, uuid_type bet2_uuid, asset matched_stake1, asset matched_stake2, int64_t matched_bet_id)
budget_closing_operation(const budget_type type, const account_name_type &owner, const int64_t id)
budget_outgo_operation(const budget_type type_, const account_name_type &owner_, const int64_t id_, const asset &cash_)
budget_owner_income_operation(const budget_type type_, const account_name_type &owner_, const int64_t id_, const asset &cash_)
comment_benefficiary_reward_operation(const account_name_type &b, const account_name_type &a, const std::string &p, const asset &r)
comment_payout_update_operation(const account_name_type &a, const std::string &p)
asset to_parent_payout
reward sent to parent as parent reward
asset author_payout
reward for comment author (including from_children_payout)
asset from_children_payout
reward received from children comments as parent reward
comment_reward_operation(const account_name_type &a, const std::string &pl, const asset &fund_reward, const asset &total_payout, const asset &author_payout, const asset &curators_payout, const asset &from_children_payout, const asset &to_parent_payout, const asset &beneficiaries_payout)
asset total_payout
reward distributed within comment across author, beneficiaries and curators (excluding reward to pare...
asset curators_payout
reward for curators (voters)
curation_reward_operation(const std::string &c, const asset &r, const std::string &a, const std::string &p)
devpool_to_acc_vesting_withdraw_operation(const std::string &t, const asset &w)
expired_contract_refund_operation(const std::string &o, const asset &v)
game_status_changed_operation(const uuid_type &game_uuid, game_status old_status, game_status new_status)
producer_reward_operation(const std::string &p, const asset &v)
proposal_virtual_operation(const protocol::proposal_operation &op)
return_scorumpower_delegation_operation(const account_name_type &a, const asset &v)
witness_miss_block_operation(const std::string &o, uint32_t num)