BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
asset_ops.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2018 Cryptonomex, Inc., 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  */
25 
26 #include <fc/io/raw.hpp>
27 
28 #include <locale>
29 
30 namespace graphene { namespace protocol {
31 
38 bool is_valid_symbol( const string& symbol )
39 {
40  static const std::locale& loc = std::locale::classic();
41  if( symbol.size() < GRAPHENE_MIN_ASSET_SYMBOL_LENGTH )
42  return false;
43 
44  if( symbol.substr(0,3) == "BIT" )
45  return false;
46 
47  if( symbol.size() > GRAPHENE_MAX_ASSET_SYMBOL_LENGTH )
48  return false;
49 
50  if( !isalpha( symbol.front(), loc ) )
51  return false;
52 
53  if( !isalnum( symbol.back(), loc ) )
54  return false;
55 
56  bool dot_already_present = false;
57  for( const auto c : symbol )
58  {
59  if( (isalpha( c, loc ) && isupper( c, loc )) || isdigit( c, loc ) )
60  continue;
61 
62  if( c == '.' )
63  {
64  if( dot_already_present )
65  return false;
66 
67  dot_already_present = true;
68  continue;
69  }
70 
71  return false;
72  }
73 
74  return true;
75 }
76 
78 {
80 }
81 
83  const optional<uint64_t>& sub_asset_creation_fee )const
84 {
85  share_type core_fee_required = param.long_symbol;
86 
87  if( sub_asset_creation_fee.valid() && symbol.find('.') != std::string::npos )
88  {
89  core_fee_required = *sub_asset_creation_fee;
90  }
91  else
92  {
93  switch( symbol.size() )
94  {
95  case 3: core_fee_required = param.symbol3;
96  break;
97  case 4: core_fee_required = param.symbol4;
98  break;
99  default:
100  break;
101  }
102  }
103 
104  // common_options contains several lists and a string. Charge fees for its size
105  core_fee_required += calculate_data_fee( fc::raw::pack_size(*this), param.price_per_kbyte );
106 
107  return core_fee_required;
108 }
109 
111 {
112  FC_ASSERT( fee.amount >= 0 );
115  // TODO fix the missing check for witness_fed_asset and committee_fed_asset with a hard fork
116  if( 0 != ( common_options.issuer_permissions & NON_UIA_ONLY_ISSUER_PERMISSION_MASK
117  & (uint16_t)( ~(witness_fed_asset|committee_fed_asset) ) ) )
118  FC_ASSERT( bitasset_opts.valid() );
120  {
121  FC_ASSERT( bitasset_opts.valid(), "Cannot have a User-Issued Asset implement a prediction market." );
124  FC_ASSERT( !bitasset_opts->extensions.value.black_swan_response_method.valid(),
125  "Can not set black_swan_response_method for Prediction Markets" );
126  }
127  if( bitasset_opts ) bitasset_opts->validate();
128 
130  FC_ASSERT(dummy.asset_id == asset_id_type(1));
131  FC_ASSERT(precision <= 12);
132 }
133 
135 {
136  FC_ASSERT( fee.amount >= 0 );
137  if( new_issuer )
140 
142  FC_ASSERT(dummy.asset_id == asset_id_type());
143 
144  if( extensions.value.new_precision.valid() )
145  FC_ASSERT( *extensions.value.new_precision <= 12 );
146 
147  if( extensions.value.skip_core_exchange_rate.valid() )
148  {
149  FC_ASSERT( *extensions.value.skip_core_exchange_rate == true,
150  "If skip_core_exchange_rate is specified, it can only be true" );
151  }
152 }
153 
155 {
156  FC_ASSERT( fee.amount >= 0 );
158 }
159 
161 {
163 }
164 
165 
167 {
168  FC_ASSERT( fee.amount >= 0 );
169  feed.validate();
170 
171  // maybe some of these could be moved to feed.validate()
173  {
175  }
177  {
179  }
180 
184 
185  if( extensions.value.initial_collateral_ratio.valid() )
186  {
187  FC_ASSERT( *extensions.value.initial_collateral_ratio >= GRAPHENE_MIN_COLLATERAL_RATIO );
188  FC_ASSERT( *extensions.value.initial_collateral_ratio <= GRAPHENE_MAX_COLLATERAL_RATIO );
189  }
190 }
191 
193 {
194  FC_ASSERT( fee.amount >= 0 );
197 }
198 
200 {
201  FC_ASSERT( fee.amount >= 0 );
204  FC_ASSERT( asset_to_issue.asset_id != asset_id_type(0) );
205 }
206 
208 {
209  FC_ASSERT( fee.amount >= 0 );
210  FC_ASSERT( fee.asset_id == asset_id_type() );
211  FC_ASSERT( amount > 0 );
212 }
213 
215 {
216  FC_ASSERT( fee.amount >= 0 );
217  FC_ASSERT( amount.amount >= 0 );
218 }
219 
221 {
222  FC_ASSERT( fee.amount >= 0 );
224 }
225 
227 {
228  FC_ASSERT( fee.amount >= 0 );
229 }
230 
232 {
233  FC_ASSERT( fee.amount >= 0 );
235 }
236 
238 {
242 
243  if( extensions.value.margin_call_fee_ratio.valid() )
244  FC_ASSERT( *extensions.value.margin_call_fee_ratio <= GRAPHENE_MAX_COLLATERAL_RATIO );
245 
246  if( extensions.value.initial_collateral_ratio.valid() )
247  {
248  FC_ASSERT( *extensions.value.initial_collateral_ratio >= GRAPHENE_MIN_COLLATERAL_RATIO );
249  FC_ASSERT( *extensions.value.initial_collateral_ratio <= GRAPHENE_MAX_COLLATERAL_RATIO );
250  }
251  if( extensions.value.maintenance_collateral_ratio.valid() )
252  {
253  FC_ASSERT( *extensions.value.maintenance_collateral_ratio >= GRAPHENE_MIN_COLLATERAL_RATIO );
254  FC_ASSERT( *extensions.value.maintenance_collateral_ratio <= GRAPHENE_MAX_COLLATERAL_RATIO );
255  }
256  if( extensions.value.maximum_short_squeeze_ratio.valid() )
257  {
258  FC_ASSERT( *extensions.value.maximum_short_squeeze_ratio >= GRAPHENE_MIN_COLLATERAL_RATIO );
259  FC_ASSERT( *extensions.value.maximum_short_squeeze_ratio <= GRAPHENE_MAX_COLLATERAL_RATIO );
260  }
261 
262  if( extensions.value.force_settle_fee_percent.valid() )
263  FC_ASSERT( *extensions.value.force_settle_fee_percent <= GRAPHENE_100_PERCENT );
264 
265  if( extensions.value.black_swan_response_method.valid() )
266  {
267  auto bsrm_count = static_cast<uint8_t>( black_swan_response_type::BSRM_TYPE_COUNT );
268  FC_ASSERT( *extensions.value.black_swan_response_method < bsrm_count,
269  "black_swan_response_method should be less than ${c}", ("c",bsrm_count) );
270  }
271 }
272 
274 {
275  FC_ASSERT( max_supply > 0 );
277  // The non-negative maker fee must be less than or equal to 100%
279 
280  // The non-negative taker fee must be less than or equal to 100%
283 
285  // There must be no high bits in permissions whose meaning is not known.
286  FC_ASSERT( 0 == (issuer_permissions & (uint16_t)(~ASSET_ISSUER_PERMISSION_MASK)) );
287  // The permission-only bits can not be set in flag
288  FC_ASSERT( 0 == (flags & global_settle),
289  "Can not set global_settle flag, it is for issuer permission only" );
290 
291  // the witness_fed and committee_fed flags cannot be set simultaneously
294  FC_ASSERT( core_exchange_rate.base.asset_id.instance.value == 0 ||
295  core_exchange_rate.quote.asset_id.instance.value == 0 );
296 
297  if(!whitelist_authorities.empty() || !blacklist_authorities.empty())
298  FC_ASSERT( 0 != (flags & white_list) );
299  for( auto item : whitelist_markets )
300  {
301  FC_ASSERT( blacklist_markets.find(item) == blacklist_markets.end() );
302  }
303  for( auto item : blacklist_markets )
304  {
305  FC_ASSERT( whitelist_markets.find(item) == whitelist_markets.end() );
306  }
309 }
310 
311 // Note: this function is only called after the BSIP 48/75 hardfork
312 void asset_options::validate_flags( bool is_market_issued, bool allow_disable_collateral_bid )const
313 {
314  FC_ASSERT( 0 == (flags & (uint16_t)(~ASSET_ISSUER_PERMISSION_MASK)),
315  "Can not set an unknown bit in flags" );
316  if( !allow_disable_collateral_bid ) // before core-2281 hf, can not set the disable_collateral_bidding bit
318  "Can not set the 'disable_collateral_bidding' bit in flags between the core-2281 hardfork "
319  "and the BSIP_48_75 hardfork" );
320  // Note: global_settle is checked in validate(), so do not check again here
322  "Can not set disable_mcr_update flag, it is for issuer permission only" );
324  "Can not set disable_icr_update flag, it is for issuer permission only" );
326  "Can not set disable_mssr_update flag, it is for issuer permission only" );
328  "Can not set disable_bsrm_update flag, it is for issuer permission only" );
329  if( !is_market_issued )
330  {
331  FC_ASSERT( 0 == (flags & (uint16_t)(~UIA_ASSET_ISSUER_PERMISSION_MASK)),
332  "Can not set a flag for bitassets only to UIA" );
333  }
334 }
335 
337 {
338  return ( (issuer_permissions & ASSET_ISSUER_PERMISSION_ENABLE_BITS_MASK)
339  | ((uint16_t)(~issuer_permissions) & ASSET_ISSUER_PERMISSION_DISABLE_BITS_MASK) );
340 }
341 
343  FC_ASSERT( fee.amount >= 0 );
345  if( extensions.value.claim_from_asset_id.valid() )
346  FC_ASSERT( *extensions.value.claim_from_asset_id != amount_to_claim.asset_id );
347 }
348 
350  FC_ASSERT( fee.amount >= 0 );
353  FC_ASSERT( amount_to_claim.asset_id == asset_id_type());
354 }
355 
356 } } // namespace graphene::protocol
357 
362 
365 
380 
GRAPHENE_MAX_SHARE_SUPPLY
constexpr int64_t GRAPHENE_MAX_SHARE_SUPPLY(1000000000000000LL)
graphene::protocol::asset_issue_operation::fee
asset fee
Definition: asset_ops.hpp:492
graphene::protocol::asset_reserve_operation::validate
void validate() const
Definition: asset_ops.cpp:192
graphene::protocol::asset_update_issuer_operation::issuer
account_id_type issuer
Definition: asset_ops.hpp:572
graphene::protocol::asset_issue_operation::fee_params_t::price_per_kbyte
uint32_t price_per_kbyte
Definition: asset_ops.hpp:489
graphene::protocol::asset_claim_pool_operation::validate
void validate() const
Definition: asset_ops.cpp:349
graphene::protocol::asset_update_operation::calculate_fee
share_type calculate_fee(const fee_params_t &k) const
Definition: asset_ops.cpp:160
graphene::protocol::asset_issue_operation::memo
optional< memo_data > memo
Definition: asset_ops.hpp:499
graphene::protocol::asset_create_operation::fee_params_t::long_symbol
uint64_t long_symbol
Definition: asset_ops.hpp:197
graphene::protocol::price_feed::core_exchange_rate
price core_exchange_rate
Price at which automatically exchanging this asset for CORE from fee pool occurs (used for paying fee...
Definition: asset.hpp:183
graphene::protocol::witness_fed_asset
@ witness_fed_asset
the bitasset is to be fed by witnesses
Definition: types.hpp:201
graphene::protocol::asset_create_operation::fee_params_t
Definition: asset_ops.hpp:194
graphene::protocol::bitasset_options::maximum_force_settlement_volume
uint16_t maximum_force_settlement_volume
Definition: asset_ops.hpp:168
graphene::protocol::asset_issue_operation::fee_params_t::fee
uint64_t fee
Definition: asset_ops.hpp:488
graphene::protocol::asset_options::market_fee_percent
uint16_t market_fee_percent
Definition: asset_ops.hpp:56
graphene::protocol::asset_options::whitelist_authorities
flat_set< account_id_type > whitelist_authorities
Definition: asset_ops.hpp:76
graphene::protocol::asset_publish_feed_operation::fee
asset fee
paid for by publisher
Definition: asset_ops.hpp:472
GRAPHENE_MIN_COLLATERAL_RATIO
#define GRAPHENE_MIN_COLLATERAL_RATIO
lower than this could result in divide by 0
Definition: config.hpp:114
graphene::protocol::asset_claim_fees_operation
used to transfer accumulated fees back to the issuer's balance.
Definition: asset_ops.hpp:529
graphene::protocol::asset_create_operation::is_prediction_market
bool is_prediction_market
For BitAssets, set this to true if the asset implements a prediction market; false otherwise.
Definition: asset_ops.hpp:219
graphene::protocol::asset_claim_fees_operation::amount_to_claim
asset amount_to_claim
Definition: asset_ops.hpp:547
graphene::protocol::asset_settle_operation::fee
asset fee
Definition: asset_ops.hpp:279
graphene::protocol::asset_claim_fees_operation::fee_params_t
Definition: asset_ops.hpp:531
graphene::protocol::asset_reserve_operation::fee_params_t
Definition: asset_ops.hpp:515
graphene::protocol::asset_options::core_exchange_rate
price core_exchange_rate
Definition: asset_ops.hpp:72
graphene::protocol::asset_create_operation::bitasset_opts
optional< bitasset_options > bitasset_opts
Options only available for BitAssets. MUST be non-null if and only if the asset is market-issued.
Definition: asset_ops.hpp:217
graphene::protocol::asset_claim_fees_operation::validate
void validate() const
Definition: asset_ops.cpp:342
graphene::protocol::asset_update_issuer_operation
Update issuer of an asset.
Definition: asset_ops.hpp:565
graphene::protocol::asset_options::whitelist_markets
flat_set< asset_id_type > whitelist_markets
Definition: asset_ops.hpp:84
graphene::protocol::price_feed::settlement_price
price settlement_price
Definition: asset.hpp:180
graphene::protocol::asset_options::blacklist_authorities
flat_set< account_id_type > blacklist_authorities
Definition: asset_ops.hpp:81
graphene::protocol::asset_publish_feed_operation::asset_id
asset_id_type asset_id
asset for which the feed is published
Definition: asset_ops.hpp:474
GRAPHENE_MAX_ASSET_SYMBOL_LENGTH
#define GRAPHENE_MAX_ASSET_SYMBOL_LENGTH
Definition: config.hpp:36
graphene::protocol::asset_options::blacklist_markets
flat_set< asset_id_type > blacklist_markets
Definition: asset_ops.hpp:86
graphene::protocol::asset_options
The asset_options struct contains options available on all assets in the network.
Definition: asset_ops.hpp:47
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION
#define GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION(type)
Definition: types.hpp:86
graphene::protocol::asset_fund_fee_pool_operation::fee_params_t
Definition: asset_ops.hpp:324
graphene::protocol::white_list
@ white_list
accounts must be whitelisted in order to hold or transact this asset
Definition: types.hpp:195
graphene::protocol::asset_update_issuer_operation::fee
asset fee
Definition: asset_ops.hpp:571
graphene::protocol::asset_claim_fees_operation::additional_options_type
Definition: asset_ops.hpp:535
graphene::protocol::asset_update_feed_producers_operation::fee_params_t
Definition: asset_ops.hpp:432
graphene::protocol::asset_update_operation::asset_to_update
asset_id_type asset_to_update
Definition: asset_ops.hpp:372
graphene::protocol::asset_options::extensions
additional_asset_options_t extensions
Definition: asset_ops.hpp:93
graphene::protocol::disable_mssr_update
@ disable_mssr_update
the bitasset owner can not update MSSR, permission only
Definition: types.hpp:221
graphene::protocol::bitasset_options
The bitasset_options struct contains configurable options available only to BitAssets.
Definition: asset_ops.hpp:109
graphene::protocol::asset_claim_fees_operation::fee
asset fee
Definition: asset_ops.hpp:545
graphene::protocol::asset_update_feed_producers_operation::validate
void validate() const
Definition: asset_ops.cpp:226
graphene::protocol::asset_update_operation::extensions
extension< ext > extensions
Definition: asset_ops.hpp:377
graphene::protocol::committee_fed_asset
@ committee_fed_asset
the bitasset is to be fed by the committee
Definition: types.hpp:202
graphene::protocol::asset_claim_pool_operation::asset_id
asset_id_type asset_id
Definition: asset_ops.hpp:609
graphene::protocol::asset_update_issuer_operation::fee_params_t
Definition: asset_ops.hpp:567
graphene::protocol::asset_create_operation::fee
asset fee
Definition: asset_ops.hpp:201
graphene::protocol::asset_create_operation::fee_params_t::symbol3
uint64_t symbol3
Definition: asset_ops.hpp:195
GRAPHENE_MIN_ASSET_SYMBOL_LENGTH
#define GRAPHENE_MIN_ASSET_SYMBOL_LENGTH
Definition: config.hpp:35
graphene::protocol::price_feed::validate
void validate() const
Definition: asset.cpp:251
graphene::protocol::asset_create_operation::fee_params_t::symbol4
uint64_t symbol4
Definition: asset_ops.hpp:196
graphene::protocol::asset_claim_pool_operation::fee_params_t
Definition: asset_ops.hpp:603
graphene::protocol::asset_publish_feed_operation::validate
void validate() const
Definition: asset_ops.cpp:166
graphene::protocol::asset_options::max_supply
share_type max_supply
Definition: asset_ops.hpp:50
graphene::protocol::asset_publish_feed_operation::extensions
extension< ext > extensions
Definition: asset_ops.hpp:476
graphene::protocol::asset_settle_operation::fee_params_t
Definition: asset_ops.hpp:269
asset_ops.hpp
graphene::protocol::asset_issue_operation::calculate_fee
share_type calculate_fee(const fee_params_t &k) const
Definition: asset_ops.cpp:77
graphene::protocol::base_operation::calculate_data_fee
static uint64_t calculate_data_fee(uint64_t bytes, uint64_t price_per_kbyte)
Definition: operations.cpp:33
graphene::protocol::asset_update_bitasset_operation::new_options
bitasset_options new_options
Definition: asset_ops.hpp:406
graphene::protocol::asset_update_operation::ext
Definition: asset_ops.hpp:353
graphene::protocol::asset_create_operation::fee_params_t::price_per_kbyte
uint32_t price_per_kbyte
Definition: asset_ops.hpp:198
graphene::protocol::asset_reserve_operation
used to take an asset out of circulation, returning to the issuer
Definition: asset_ops.hpp:513
graphene::protocol::asset_update_operation
Update options common to all assets.
Definition: asset_ops.hpp:351
fc::optional::valid
bool valid() const
Definition: optional.hpp:186
graphene::protocol::asset_global_settle_operation::asset_to_settle
asset_id_type asset_to_settle
Definition: asset_ops.hpp:244
graphene::protocol::asset_create_operation::precision
uint8_t precision
Number of digits to the right of decimal point, must be less than or equal to 12.
Definition: asset_ops.hpp:207
graphene::protocol::asset::asset_id
asset_id_type asset_id
Definition: asset.hpp:37
graphene::protocol::asset_create_operation::validate
void validate() const
Definition: asset_ops.cpp:110
graphene::protocol::asset_issue_operation::asset_to_issue
asset asset_to_issue
Definition: asset_ops.hpp:494
graphene::protocol::asset_options::issuer_permissions
uint16_t issuer_permissions
The flags which the issuer has permission to update. See asset_issuer_permission_flags.
Definition: asset_ops.hpp:61
graphene::protocol::asset_publish_feed_operation::fee_params_t
Definition: asset_ops.hpp:470
graphene::protocol::asset_update_bitasset_operation::fee_params_t
Definition: asset_ops.hpp:400
graphene::protocol::asset_create_operation::calculate_fee
share_type calculate_fee(const fee_params_t &k, const optional< uint64_t > &sub_asset_creation_fee) const
Definition: asset_ops.cpp:82
graphene::protocol::price::is_null
bool is_null() const
Definition: asset.cpp:229
graphene::protocol::bitasset_options::ext
Definition: asset_ops.hpp:139
graphene::protocol::asset_global_settle_operation::validate
void validate() const
Definition: asset_ops.cpp:231
graphene::protocol::disable_icr_update
@ disable_icr_update
the bitasset owner can not update ICR, permission only
Definition: types.hpp:220
graphene::protocol::asset_global_settle_operation::fee_params_t
Definition: asset_ops.hpp:240
fc::raw::pack_size
size_t pack_size(const T &v)
Definition: raw.hpp:757
graphene::protocol::asset_options::validate
void validate() const
Definition: asset_ops.cpp:273
graphene::protocol::asset_update_bitasset_operation
Update options specific to BitAssets.
Definition: asset_ops.hpp:398
graphene::protocol::asset_create_operation::symbol
string symbol
The ticker symbol of this asset.
Definition: asset_ops.hpp:205
graphene::protocol::asset_issue_operation::validate
void validate() const
Definition: asset_ops.cpp:199
graphene::protocol::global_settle
@ global_settle
allow the bitasset owner to force a global settlement, permission only
Definition: types.hpp:199
graphene::protocol::asset_update_feed_producers_operation::fee
asset fee
Definition: asset_ops.hpp:434
graphene::protocol::asset_publish_feed_operation
Publish price feeds for market-issued assets.
Definition: asset_ops.hpp:462
graphene::protocol::asset_settle_cancel_operation
Definition: asset_ops.hpp:293
graphene::protocol::bitasset_options::validate
void validate() const
Definition: asset_ops.cpp:237
graphene::protocol::additional_asset_options::reward_percent
fc::optional< uint16_t > reward_percent
Definition: asset_ops.hpp:33
graphene::protocol::asset_options::flags
uint16_t flags
The currently active flags on this permission. See asset_issuer_permission_flags.
Definition: asset_ops.hpp:63
graphene::protocol::bitasset_options::black_swan_response_type::BSRM_TYPE_COUNT
@ BSRM_TYPE_COUNT
Total number of available black swan response methods.
graphene::protocol::additional_asset_options
Definition: asset_ops.hpp:31
graphene::protocol::asset_issue_operation::fee_params_t
Definition: asset_ops.hpp:487
graphene::protocol::is_valid_symbol
bool is_valid_symbol(const string &symbol)
Definition: asset_ops.cpp:38
graphene::protocol::asset_claim_fees_operation::extensions
extension< additional_options_type > extensions
Definition: asset_ops.hpp:549
graphene::protocol::asset_update_operation::new_options
asset_options new_options
Definition: asset_ops.hpp:376
graphene::protocol::asset_reserve_operation::amount_to_reserve
asset amount_to_reserve
Definition: asset_ops.hpp:519
FC_ASSERT
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
Definition: exception.hpp:345
graphene::protocol::price::validate
void validate(bool check_upper_bound=false) const
Check if the object is valid.
Definition: asset.cpp:235
graphene::protocol::asset_fund_fee_pool_operation::validate
void validate() const
Definition: asset_ops.cpp:207
graphene::protocol::asset_update_operation::issuer
account_id_type issuer
Definition: asset_ops.hpp:371
graphene::protocol::asset_update_feed_producers_operation
Update the set of feed-producing accounts for a BitAsset.
Definition: asset_ops.hpp:430
graphene::protocol::asset_settle_operation
Schedules a market-issued asset for automatic settlement.
Definition: asset_ops.hpp:267
graphene::protocol::asset_options::validate_flags
void validate_flags(bool is_market_issued, bool allow_disable_collateral_bid=true) const
Definition: asset_ops.cpp:312
graphene::protocol::asset_create_operation::common_options
asset_options common_options
Definition: asset_ops.hpp:215
graphene::protocol::asset::amount
share_type amount
Definition: asset.hpp:36
graphene::protocol::asset_global_settle_operation::settle_price
price settle_price
Definition: asset_ops.hpp:245
graphene::protocol::asset_update_bitasset_operation::validate
void validate() const
Definition: asset_ops.cpp:220
graphene::protocol::asset_options::max_market_fee
share_type max_market_fee
Market fees calculated as market_fee_percent of the traded volume are capped to this value.
Definition: asset_ops.hpp:58
graphene::protocol::asset_fund_fee_pool_operation::amount
share_type amount
core asset
Definition: asset_ops.hpp:329
graphene::protocol::asset_update_operation::fee_params_t::fee
uint64_t fee
Definition: asset_ops.hpp:364
graphene::protocol::price::base
asset base
Definition: asset.hpp:113
graphene::protocol::asset_fund_fee_pool_operation
Definition: asset_ops.hpp:322
GRAPHENE_MAX_COLLATERAL_RATIO
#define GRAPHENE_MAX_COLLATERAL_RATIO
higher than this is unnecessary and may exceed int16 storage
Definition: config.hpp:115
graphene::protocol::asset_update_bitasset_operation::fee
asset fee
Definition: asset_ops.hpp:402
graphene::protocol::asset_settle_operation::validate
void validate() const
Definition: asset_ops.cpp:214
fc::optional
provides stack-based nullable value similar to boost::optional
Definition: optional.hpp:20
graphene::protocol::disable_collateral_bidding
@ disable_collateral_bidding
Can not bid collateral after a global settlement.
Definition: types.hpp:223
graphene::protocol::asset_global_settle_operation::fee
asset fee
Definition: asset_ops.hpp:242
graphene::protocol::asset
Definition: asset.hpp:31
graphene::protocol::asset_update_operation::fee_params_t
Definition: asset_ops.hpp:363
graphene::protocol::asset_update_operation::validate
void validate() const
Definition: asset_ops.cpp:134
graphene::protocol::asset_update_operation::new_issuer
optional< account_id_type > new_issuer
If the asset is to be given a new issuer, specify his ID here.
Definition: asset_ops.hpp:375
graphene::protocol::price_feed::is_for
bool is_for(asset_id_type asset_id) const
Definition: asset.cpp:266
graphene::protocol::asset_fund_fee_pool_operation::fee
asset fee
core asset
Definition: asset_ops.hpp:326
graphene::protocol::asset_reserve_operation::fee
asset fee
Definition: asset_ops.hpp:517
fc::safe::value
T value
Definition: safe.hpp:28
graphene::protocol::asset_publish_feed_operation::ext
Definition: asset_ops.hpp:464
graphene::protocol::asset_claim_pool_operation::fee
asset fee
Definition: asset_ops.hpp:607
graphene::protocol::asset_options::get_enabled_issuer_permissions_mask
uint16_t get_enabled_issuer_permissions_mask() const
Definition: asset_ops.cpp:336
graphene::protocol::bitasset_options::force_settlement_offset_percent
uint16_t force_settlement_offset_percent
This is the percent to adjust the feed price in the short's favor in the event of a forced settlement...
Definition: asset_ops.hpp:162
graphene::protocol::asset_update_operation::fee_params_t::price_per_kbyte
uint32_t price_per_kbyte
Definition: asset_ops.hpp:365
graphene::protocol::asset_issue_operation
Definition: asset_ops.hpp:485
graphene::protocol::asset_update_issuer_operation::new_issuer
account_id_type new_issuer
Definition: asset_ops.hpp:574
graphene::protocol::disable_bsrm_update
@ disable_bsrm_update
the bitasset owner can not update BSRM, permission only
Definition: types.hpp:222
graphene::protocol::asset_update_operation::fee
asset fee
Definition: asset_ops.hpp:370
graphene::protocol::asset_global_settle_operation
allows global settling of bitassets (black swan or prediction markets)
Definition: asset_ops.hpp:238
graphene::protocol::price::quote
asset quote
Definition: asset.hpp:114
GRAPHENE_100_PERCENT
#define GRAPHENE_100_PERCENT
Definition: config.hpp:102
graphene
Definition: api.cpp:48
graphene::protocol::extension::value
T value
Definition: ext.hpp:40
graphene::protocol::asset_create_operation
Definition: asset_ops.hpp:192
graphene::protocol::bitasset_options::extensions
extension< ext > extensions
Definition: asset_ops.hpp:173
graphene::protocol::asset_update_issuer_operation::validate
void validate() const
Definition: asset_ops.cpp:154
graphene::protocol::asset_claim_pool_operation::amount_to_claim
asset amount_to_claim
fee.asset_id must != asset_id
Definition: asset_ops.hpp:610
graphene::protocol::asset_claim_pool_operation
Transfers BTS from the fee pool of a specified asset back to the issuer's balance.
Definition: asset_ops.hpp:601
graphene::protocol::additional_asset_options::taker_fee_percent
fc::optional< uint16_t > taker_fee_percent
Definition: asset_ops.hpp:36
graphene::protocol::disable_mcr_update
@ disable_mcr_update
the bitasset owner can not update MCR, permission only
Definition: types.hpp:219
graphene::protocol::asset_settle_operation::amount
asset amount
Amount of asset to force settle. This must be a market-issued asset.
Definition: asset_ops.hpp:283
graphene::protocol::asset_publish_feed_operation::feed
price_feed feed
Definition: asset_ops.hpp:475
raw.hpp
fc::safe
Definition: safe.hpp:26
graphene::protocol::bitasset_options::minimum_feeds
uint8_t minimum_feeds
Minimum number of unexpired feeds required to extract a median feed from.
Definition: asset_ops.hpp:158