BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
samet_fund.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 Abit More, and contributors.
3  *
4  * The MIT License
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 #pragma once
27 
28 namespace graphene { namespace protocol {
29 
37  {
38  struct fee_params_t { uint64_t fee = 1 * GRAPHENE_BLOCKCHAIN_PRECISION; };
39 
41  account_id_type owner_account;
42  asset_id_type asset_type;
44  uint32_t fee_rate = 0;
45 
47 
48  account_id_type fee_payer()const { return owner_account; }
49  void validate()const override;
50  };
51 
57  {
58  struct fee_params_t { uint64_t fee = 0; };
59 
61  account_id_type owner_account;
62  samet_fund_id_type fund_id;
63 
65 
66  account_id_type fee_payer()const { return owner_account; }
67  void validate()const override;
68  };
69 
75  {
76  struct fee_params_t { uint64_t fee = 1 * GRAPHENE_BLOCKCHAIN_PRECISION; };
77 
79  account_id_type owner_account;
80  samet_fund_id_type fund_id;
83 
85 
86  account_id_type fee_payer()const { return owner_account; }
87  void validate()const override;
88  };
89 
95  {
96  struct fee_params_t { uint64_t fee = 1 * GRAPHENE_BLOCKCHAIN_PRECISION; };
97 
99  account_id_type borrower;
100  samet_fund_id_type fund_id;
102 
104 
105  account_id_type fee_payer()const { return borrower; }
106  void validate()const override;
107  };
108 
114  {
115  struct fee_params_t { uint64_t fee = 1 * GRAPHENE_BLOCKCHAIN_PRECISION; };
116 
118  account_id_type account;
119  samet_fund_id_type fund_id;
122 
124 
125  account_id_type fee_payer()const { return account; }
126  void validate()const override;
127  };
128 
129 } } // graphene::protocol
130 
136 
138  (fee)(owner_account)(asset_type)(balance)(fee_rate)(extensions) )
140  (fee)(owner_account)(fund_id)(extensions) )
142  (fee)(owner_account)(fund_id)(delta_amount)(new_fee_rate)(extensions) )
144  (fee)(borrower)(fund_id)(borrow_amount)(extensions) )
146  (fee)(account)(fund_id)(repay_amount)(fund_fee)(extensions) )
147 
153 
graphene::protocol::samet_fund_update_operation::new_fee_rate
optional< uint32_t > new_fee_rate
New fee rate, optional.
Definition: samet_fund.hpp:82
graphene::protocol::samet_fund_repay_operation::fund_id
samet_fund_id_type fund_id
ID of the SameT Fund.
Definition: samet_fund.hpp:119
graphene::protocol::samet_fund_create_operation::fee_rate
uint32_t fee_rate
Fee rate, the demominator is GRAPHENE_FEE_RATE_DENOM.
Definition: samet_fund.hpp:44
graphene::protocol::samet_fund_update_operation::fee_params_t
Definition: samet_fund.hpp:76
graphene::protocol::samet_fund_delete_operation
Delete a SameT Fund object.
Definition: samet_fund.hpp:56
graphene::protocol::samet_fund_borrow_operation::fee
asset fee
Operation fee.
Definition: samet_fund.hpp:98
graphene::protocol::samet_fund_update_operation::fund_id
samet_fund_id_type fund_id
ID of the SameT Fund object.
Definition: samet_fund.hpp:80
graphene::protocol::samet_fund_repay_operation::fee_params_t::fee
uint64_t fee
Definition: samet_fund.hpp:115
graphene::protocol::samet_fund_borrow_operation::fee_params_t::fee
uint64_t fee
Definition: samet_fund.hpp:96
graphene::protocol::samet_fund_create_operation::balance
share_type balance
Usable amount in the fund.
Definition: samet_fund.hpp:43
graphene::protocol::samet_fund_update_operation::fee
asset fee
Operation fee.
Definition: samet_fund.hpp:78
graphene::protocol::samet_fund_repay_operation::fee_params_t
Definition: samet_fund.hpp:115
graphene::protocol::samet_fund_update_operation::delta_amount
optional< asset > delta_amount
Delta amount, optional.
Definition: samet_fund.hpp:81
graphene::protocol::base_operation
Definition: base.hpp:124
graphene::protocol::samet_fund_borrow_operation::borrower
account_id_type borrower
The account who borrows from the fund.
Definition: samet_fund.hpp:99
graphene::protocol::samet_fund_create_operation::fee_params_t::fee
uint64_t fee
Definition: samet_fund.hpp:38
graphene::protocol::samet_fund_borrow_operation
Borrow from a SameT Fund.
Definition: samet_fund.hpp:94
graphene::protocol::samet_fund_update_operation::fee_payer
account_id_type fee_payer() const
Definition: samet_fund.hpp:86
graphene::protocol::samet_fund_create_operation
Create a new SameT Fund object.
Definition: samet_fund.hpp:36
graphene::protocol::samet_fund_update_operation
Update a SameT Fund object.
Definition: samet_fund.hpp:74
graphene::protocol::samet_fund_repay_operation::fee
asset fee
Operation fee.
Definition: samet_fund.hpp:117
graphene::protocol::samet_fund_repay_operation::validate
void validate() const override
Definition: samet_fund.cpp:55
graphene::protocol::samet_fund_update_operation::owner_account
account_id_type owner_account
Owner of the fund.
Definition: samet_fund.hpp:79
graphene::protocol::samet_fund_borrow_operation::fund_id
samet_fund_id_type fund_id
ID of the SameT Fund.
Definition: samet_fund.hpp:100
graphene::protocol::samet_fund_create_operation::fee
asset fee
Operation fee.
Definition: samet_fund.hpp:40
graphene::protocol::samet_fund_create_operation::fee_payer
account_id_type fee_payer() const
Definition: samet_fund.hpp:48
graphene::protocol::samet_fund_delete_operation::fee
asset fee
Operation fee.
Definition: samet_fund.hpp:60
GRAPHENE_BLOCKCHAIN_PRECISION
#define GRAPHENE_BLOCKCHAIN_PRECISION
Definition: config.hpp:29
graphene::protocol::samet_fund_delete_operation::fee_payer
account_id_type fee_payer() const
Definition: samet_fund.hpp:66
graphene::protocol::samet_fund_borrow_operation::fee_params_t
Definition: samet_fund.hpp:96
graphene::protocol::samet_fund_repay_operation::account
account_id_type account
The account who repays to the SameT Fund.
Definition: samet_fund.hpp:118
graphene::protocol::samet_fund_repay_operation::fee_payer
account_id_type fee_payer() const
Definition: samet_fund.hpp:125
graphene::protocol::samet_fund_delete_operation::extensions
extensions_type extensions
Unused. Reserved for future use.
Definition: samet_fund.hpp:64
graphene::protocol::samet_fund_update_operation::validate
void validate() const override
Definition: samet_fund.cpp:41
GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION
#define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type)
Definition: types.hpp:85
graphene::protocol::samet_fund_delete_operation::validate
void validate() const override
Definition: samet_fund.cpp:36
graphene::protocol::samet_fund_repay_operation::repay_amount
asset repay_amount
The amount to repay.
Definition: samet_fund.hpp:120
graphene::protocol::samet_fund_borrow_operation::extensions
extensions_type extensions
Unused. Reserved for future use.
Definition: samet_fund.hpp:103
base.hpp
graphene::protocol::samet_fund_create_operation::extensions
extensions_type extensions
Unused. Reserved for future use.
Definition: samet_fund.hpp:46
graphene::protocol::samet_fund_delete_operation::fee_params_t::fee
uint64_t fee
Definition: samet_fund.hpp:58
graphene::protocol::samet_fund_repay_operation::fund_fee
asset fund_fee
Fee for using the fund.
Definition: samet_fund.hpp:121
graphene::protocol::samet_fund_create_operation::asset_type
asset_id_type asset_type
Asset type in the fund.
Definition: samet_fund.hpp:42
graphene::protocol::samet_fund_update_operation::extensions
extensions_type extensions
Unused. Reserved for future use.
Definition: samet_fund.hpp:84
graphene::protocol::samet_fund_repay_operation::extensions
extensions_type extensions
Unused. Reserved for future use.
Definition: samet_fund.hpp:123
graphene::protocol::samet_fund_borrow_operation::fee_payer
account_id_type fee_payer() const
Definition: samet_fund.hpp:105
graphene::protocol::samet_fund_create_operation::owner_account
account_id_type owner_account
Owner of the fund.
Definition: samet_fund.hpp:41
graphene::protocol::samet_fund_delete_operation::fee_params_t
Definition: samet_fund.hpp:58
FC_REFLECT
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:388
graphene::protocol::samet_fund_create_operation::validate
void validate() const override
Definition: samet_fund.cpp:30
graphene::protocol::samet_fund_repay_operation
Repay to a SameT Fund.
Definition: samet_fund.hpp:113
graphene::protocol::samet_fund_delete_operation::owner_account
account_id_type owner_account
The account who owns the SameT Fund object.
Definition: samet_fund.hpp:61
fc::optional
provides stack-based nullable value similar to boost::optional
Definition: optional.hpp:20
graphene::protocol::asset
Definition: asset.hpp:31
graphene::protocol::samet_fund_create_operation::fee_params_t
Definition: samet_fund.hpp:38
graphene::protocol::samet_fund_borrow_operation::validate
void validate() const override
Definition: samet_fund.cpp:49
asset.hpp
graphene::protocol::samet_fund_borrow_operation::borrow_amount
asset borrow_amount
The amount to borrow.
Definition: samet_fund.hpp:101
graphene::protocol::samet_fund_update_operation::fee_params_t::fee
uint64_t fee
Definition: samet_fund.hpp:76
graphene
Definition: api.cpp:48
graphene::protocol::samet_fund_delete_operation::fund_id
samet_fund_id_type fund_id
ID of the SameT Fund object.
Definition: samet_fund.hpp:62
graphene::protocol::extensions_type
future_extensions::flat_set_type extensions_type
Definition: base.hpp:156
fc::safe
Definition: safe.hpp:26