BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Go to the documentation of this file.
30 namespace graphene {
namespace protocol {
40 static const std::locale& loc = std::locale::classic();
44 if( symbol.substr(0,3) ==
"BIT" )
50 if( !isalpha( symbol.front(), loc ) )
53 if( !isalnum( symbol.back(), loc ) )
56 bool dot_already_present =
false;
57 for(
const auto c : symbol )
59 if( (isalpha( c, loc ) && isupper( c, loc )) || isdigit( c, loc ) )
64 if( dot_already_present )
67 dot_already_present =
true;
87 if( sub_asset_creation_fee.
valid() &&
symbol.find(
'.') != std::string::npos )
89 core_fee_required = *sub_asset_creation_fee;
95 case 3: core_fee_required = param.
symbol3;
97 case 4: core_fee_required = param.
symbol4;
107 return core_fee_required;
125 "Can not set black_swan_response_method for Prediction Markets" );
147 if(
extensions.value.skip_core_exchange_rate.valid() )
150 "If skip_core_exchange_rate is specified, it can only be true" );
185 if(
extensions.value.initial_collateral_ratio.valid() )
243 if(
extensions.value.margin_call_fee_ratio.valid() )
246 if(
extensions.value.initial_collateral_ratio.valid() )
251 if(
extensions.value.maintenance_collateral_ratio.valid() )
256 if(
extensions.value.maximum_short_squeeze_ratio.valid() )
262 if(
extensions.value.force_settle_fee_percent.valid() )
265 if(
extensions.value.black_swan_response_method.valid() )
269 "black_swan_response_method should be less than ${c}", (
"c",bsrm_count) );
289 "Can not set global_settle flag, it is for issuer permission only" );
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 )
318 "Can not set the 'disable_collateral_bidding' bit in flags between the core-2281 hardfork "
319 "and the BSIP_48_75 hardfork" );
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 )
331 FC_ASSERT( 0 == (
flags & (uint16_t)(~UIA_ASSET_ISSUER_PERMISSION_MASK)),
332 "Can not set a flag for bitassets only to UIA" );
345 if(
extensions.value.claim_from_asset_id.valid() )
constexpr int64_t GRAPHENE_MAX_SHARE_SUPPLY(1000000000000000LL)
share_type calculate_fee(const fee_params_t &k) const
optional< memo_data > memo
price core_exchange_rate
Price at which automatically exchanging this asset for CORE from fee pool occurs (used for paying fee...
@ witness_fed_asset
the bitasset is to be fed by witnesses
uint16_t maximum_force_settlement_volume
uint16_t market_fee_percent
flat_set< account_id_type > whitelist_authorities
asset fee
paid for by publisher
#define GRAPHENE_MIN_COLLATERAL_RATIO
lower than this could result in divide by 0
used to transfer accumulated fees back to the issuer's balance.
bool is_prediction_market
For BitAssets, set this to true if the asset implements a prediction market; false otherwise.
optional< bitasset_options > bitasset_opts
Options only available for BitAssets. MUST be non-null if and only if the asset is market-issued.
Update issuer of an asset.
flat_set< asset_id_type > whitelist_markets
flat_set< account_id_type > blacklist_authorities
asset_id_type asset_id
asset for which the feed is published
#define GRAPHENE_MAX_ASSET_SYMBOL_LENGTH
flat_set< asset_id_type > blacklist_markets
The asset_options struct contains options available on all assets in the network.
#define GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION(type)
@ white_list
accounts must be whitelisted in order to hold or transact this asset
asset_id_type asset_to_update
additional_asset_options_t extensions
@ disable_mssr_update
the bitasset owner can not update MSSR, permission only
The bitasset_options struct contains configurable options available only to BitAssets.
extension< ext > extensions
@ committee_fed_asset
the bitasset is to be fed by the committee
#define GRAPHENE_MIN_ASSET_SYMBOL_LENGTH
extension< ext > extensions
share_type calculate_fee(const fee_params_t &k) const
static uint64_t calculate_data_fee(uint64_t bytes, uint64_t price_per_kbyte)
bitasset_options new_options
used to take an asset out of circulation, returning to the issuer
Update options common to all assets.
asset_id_type asset_to_settle
uint8_t precision
Number of digits to the right of decimal point, must be less than or equal to 12.
uint16_t issuer_permissions
The flags which the issuer has permission to update. See asset_issuer_permission_flags.
share_type calculate_fee(const fee_params_t &k, const optional< uint64_t > &sub_asset_creation_fee) const
@ disable_icr_update
the bitasset owner can not update ICR, permission only
size_t pack_size(const T &v)
Update options specific to BitAssets.
string symbol
The ticker symbol of this asset.
@ global_settle
allow the bitasset owner to force a global settlement, permission only
Publish price feeds for market-issued assets.
fc::optional< uint16_t > reward_percent
uint16_t flags
The currently active flags on this permission. See asset_issuer_permission_flags.
@ BSRM_TYPE_COUNT
Total number of available black swan response methods.
bool is_valid_symbol(const string &symbol)
extension< additional_options_type > extensions
asset_options new_options
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
void validate(bool check_upper_bound=false) const
Check if the object is valid.
Update the set of feed-producing accounts for a BitAsset.
Schedules a market-issued asset for automatic settlement.
void validate_flags(bool is_market_issued, bool allow_disable_collateral_bid=true) const
asset_options common_options
share_type max_market_fee
Market fees calculated as market_fee_percent of the traded volume are capped to this value.
share_type amount
core asset
#define GRAPHENE_MAX_COLLATERAL_RATIO
higher than this is unnecessary and may exceed int16 storage
provides stack-based nullable value similar to boost::optional
@ disable_collateral_bidding
Can not bid collateral after a global settlement.
optional< account_id_type > new_issuer
If the asset is to be given a new issuer, specify his ID here.
bool is_for(asset_id_type asset_id) const
uint16_t get_enabled_issuer_permissions_mask() const
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...
account_id_type new_issuer
@ disable_bsrm_update
the bitasset owner can not update BSRM, permission only
allows global settling of bitassets (black swan or prediction markets)
#define GRAPHENE_100_PERCENT
extension< ext > extensions
asset amount_to_claim
fee.asset_id must != asset_id
Transfers BTS from the fee pool of a specified asset back to the issuer's balance.
fc::optional< uint16_t > taker_fee_percent
@ disable_mcr_update
the bitasset owner can not update MCR, permission only
asset amount
Amount of asset to force settle. This must be a market-issued asset.
uint8_t minimum_feeds
Minimum number of unexpired feeds required to extract a median feed from.