reserve tokens
This commit is contained in:
parent
5dc753054b
commit
b8e4511232
3 changed files with 21 additions and 2 deletions
|
|
@ -42,8 +42,7 @@ void_result asset_create_evaluator::do_evaluate( const asset_create_operation& o
|
|||
|
||||
database& d = db();
|
||||
|
||||
if (d.head_block_time() < HARDFORK_SON_TIME)
|
||||
FC_ASSERT(op.symbol != "BTC", "BTC asset creation before SON hardfork");
|
||||
FC_ASSERT(d.is_asset_creation_allowed(op.symbol), "Asset creation not allowed at current time");
|
||||
|
||||
const auto& chain_parameters = d.get_global_properties().parameters;
|
||||
FC_ASSERT( op.common_options.whitelist_authorities.size() <= chain_parameters.maximum_asset_whitelist_authorities );
|
||||
|
|
@ -191,6 +190,8 @@ void_result lottery_asset_create_evaluator::do_evaluate( const lottery_asset_cre
|
|||
|
||||
database& d = db();
|
||||
|
||||
FC_ASSERT(d.is_asset_creation_allowed(op.symbol), "Lottery asset creation not allowed at current time");
|
||||
|
||||
const auto& chain_parameters = d.get_global_properties().parameters;
|
||||
FC_ASSERT( op.common_options.whitelist_authorities.size() <= chain_parameters.maximum_asset_whitelist_authorities );
|
||||
FC_ASSERT( op.common_options.blacklist_authorities.size() <= chain_parameters.maximum_asset_whitelist_authorities );
|
||||
|
|
|
|||
|
|
@ -315,6 +315,23 @@ bool database::is_son_active( son_id_type son_id )
|
|||
return (it_son != active_son_ids.end());
|
||||
}
|
||||
|
||||
bool database::is_asset_creation_allowed(const string &symbol)
|
||||
{
|
||||
time_point_sec now = head_block_time();
|
||||
if (symbol == "BTC")
|
||||
{
|
||||
if (now < HARDFORK_SON_TIME)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (symbol == "ETH" || symbol == "EOS" || symbol == "BNB" || symbol == "ADA" || symbol == "FIL" || symbol == "DOT")
|
||||
{
|
||||
if (now >= HARDFORK_SON_TIME)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
vector<uint64_t> database::get_random_numbers(uint64_t minimum, uint64_t maximum, uint64_t selections, bool duplicates)
|
||||
{
|
||||
FC_ASSERT( selections <= 100000 );
|
||||
|
|
|
|||
|
|
@ -312,6 +312,7 @@ namespace graphene { namespace chain {
|
|||
signed_transaction create_signed_transaction( const fc::ecc::private_key& signing_private_key, const operation& op );
|
||||
bool is_son_dereg_valid( son_id_type son_id );
|
||||
bool is_son_active( son_id_type son_id );
|
||||
bool is_asset_creation_allowed(const string& symbol);
|
||||
|
||||
time_point_sec head_block_time()const;
|
||||
uint32_t head_block_num()const;
|
||||
|
|
|
|||
Loading…
Reference in a new issue