BitShares-Core  6.0.1
BitShares blockchain implementation and command-line interface 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  {
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_parameters_type { 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  {
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  {
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  {
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 
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 
future_extensions::flat_set_type extensions_type
Definition: base.hpp:155
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:388
extensions_type extensions
Unused. Reserved for future use.
Definition: samet_fund.hpp:84
Definition: api.cpp:56
extensions_type extensions
Unused. Reserved for future use.
Definition: samet_fund.hpp:123
extensions_type extensions
Unused. Reserved for future use.
Definition: samet_fund.hpp:46
asset fund_fee
Fee for using the fund.
Definition: samet_fund.hpp:121
Create a new SameT Fund objectA SameT Fund is a fund which can be used by a borrower and have to be r...
Definition: samet_fund.hpp:36
asset_id_type asset_type
Asset type in the fund.
Definition: samet_fund.hpp:42
provides stack-based nullable value similar to boost::optional
Definition: optional.hpp:20
account_id_type owner_account
Owner of the fund.
Definition: samet_fund.hpp:79
optional< uint32_t > new_fee_rate
New fee rate, optional.
Definition: samet_fund.hpp:82
#define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type)
Definition: types.hpp:85
extensions_type extensions
Unused. Reserved for future use.
Definition: samet_fund.hpp:103
optional< asset > delta_amount
Delta amount, optional.
Definition: samet_fund.hpp:81
samet_fund_id_type fund_id
ID of the SameT Fund.
Definition: samet_fund.hpp:119
#define GRAPHENE_BLOCKCHAIN_PRECISION
Definition: config.hpp:29
account_id_type borrower
The account who borrows from the fund.
Definition: samet_fund.hpp:99
share_type balance
Usable amount in the fund.
Definition: samet_fund.hpp:43
samet_fund_id_type fund_id
ID of the SameT Fund object.
Definition: samet_fund.hpp:80
uint32_t fee_rate
Fee rate, the demominator is GRAPHENE_FEE_RATE_DENOM.
Definition: samet_fund.hpp:44
account_id_type account
The account who repays to the SameT Fund.
Definition: samet_fund.hpp:118
samet_fund_id_type fund_id
ID of the SameT Fund object.
Definition: samet_fund.hpp:62
samet_fund_id_type fund_id
ID of the SameT Fund.
Definition: samet_fund.hpp:100
account_id_type owner_account
Owner of the fund.
Definition: samet_fund.hpp:41
account_id_type owner_account
The account who owns the SameT Fund object.
Definition: samet_fund.hpp:61
extensions_type extensions
Unused. Reserved for future use.
Definition: samet_fund.hpp:64