From a1edcf49a4f6ba060f939042f77d2bb0b3e4fcdf Mon Sep 17 00:00:00 2001 From: wangxxzhiyy Date: Thu, 12 Nov 2020 08:14:52 +0800 Subject: [PATCH] Stop triple subsidy when selling HDD --- contracts/hddpool/hddpool.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contracts/hddpool/hddpool.cpp b/contracts/hddpool/hddpool.cpp index ef2e25dbc..da54d50c0 100644 --- a/contracts/hddpool/hddpool.cpp +++ b/contracts/hddpool/hddpool.cpp @@ -362,7 +362,11 @@ void hddpool::sellhdd(name user, int64_t amount, std::string memo) if(user.value == ecologyfound_acc.value) return; - + + uint64_t curtime = current_time()/1000000ll; //seconds + if(curtime>1605243600) //2020-11-13 13:00:00 + return; + if(_gparmas_state.dup_remove_ratio < 40000) { int64_t _yta_amount2 =(int64_t)( ( (double)amount/10000) * ((double)_gparmas_state.hdd_price/(double)_gparmas_state.yta_price) * ((double)(40000-_gparmas_state.dup_remove_ratio)/10000) * ((double)_gparmas_state.dup_remove_dist_ratio/10000) ); asset quant2{_yta_amount2, CORE_SYMBOL}; @@ -371,7 +375,7 @@ void hddpool::sellhdd(name user, int64_t amount, std::string memo) token_account, N(transfer), std::make_tuple(hdd_subsidy_acc, user, quant2, std::string("hdd subsidy"))) .send(); - } + } } -- GitLab