diff --git a/CMakeLists.txt b/CMakeLists.txt index ebb9aef32..e21c73d0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ project(eosio_contracts) set(VERSION_MAJOR 1) set(VERSION_MINOR 8) -set(VERSION_PATCH 1) +set(VERSION_PATCH 2) #set(VERSION_SUFFIX develop) if (VERSION_SUFFIX) diff --git a/README.md b/README.md index f3178f535..b98bf5db5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # eosio.contracts -## Version : 1.8.1 +## Version : 1.8.2 The design of the EOSIO blockchain calls for a number of smart contracts that are run at a privileged permission level in order to support functions such as block producer registration and voting, token staking for CPU and network bandwidth, RAM purchasing, multi-sig, etc. These smart contracts are referred to as the bios, system, msig, wrap (formerly known as sudo) and token contracts. diff --git a/contracts/eosio.system/src/delegate_bandwidth.cpp b/contracts/eosio.system/src/delegate_bandwidth.cpp index e1ecbd1f2..d15a8202a 100644 --- a/contracts/eosio.system/src/delegate_bandwidth.cpp +++ b/contracts/eosio.system/src/delegate_bandwidth.cpp @@ -392,7 +392,7 @@ namespace eosiosystem { check( unstake_cpu_quantity >= zero_asset, "must unstake a positive amount" ); check( unstake_net_quantity >= zero_asset, "must unstake a positive amount" ); check( unstake_cpu_quantity.amount + unstake_net_quantity.amount > 0, "must unstake a positive amount" ); - check( _gstate.total_activated_stake >= min_activated_stake, + check( _gstate.thresh_activated_stake_time != time_point(), "cannot undelegate bandwidth until the chain is activated (at least 15% of all tokens participate in voting)" ); changebw( from, receiver, -unstake_net_quantity, -unstake_cpu_quantity, false); diff --git a/contracts/eosio.system/src/producer_pay.cpp b/contracts/eosio.system/src/producer_pay.cpp index cf7e2ddeb..4db2f7740 100644 --- a/contracts/eosio.system/src/producer_pay.cpp +++ b/contracts/eosio.system/src/producer_pay.cpp @@ -21,8 +21,8 @@ namespace eosiosystem { // is eventually completely removed, at which point this line can be removed. _gstate2.last_block_num = timestamp; - /** until activated stake crosses this threshold no new rewards are paid */ - if( _gstate.total_activated_stake < min_activated_stake ) + /** until activation, no new rewards are paid */ + if( _gstate.thresh_activated_stake_time == time_point() ) return; if( _gstate.last_pervote_bucket_fill == time_point() ) /// start the presses @@ -71,7 +71,7 @@ namespace eosiosystem { const auto& prod = _producers.get( owner.value ); check( prod.active(), "producer does not have an active key" ); - check( _gstate.total_activated_stake >= min_activated_stake, + check( _gstate.thresh_activated_stake_time != time_point(), "cannot claim rewards until the chain is activated (at least 15% of all tokens participate in voting)" ); const auto ct = current_time_point(); diff --git a/contracts/eosio.system/src/voting.cpp b/contracts/eosio.system/src/voting.cpp index 95f1dd36a..5386fb502 100644 --- a/contracts/eosio.system/src/voting.cpp +++ b/contracts/eosio.system/src/voting.cpp @@ -188,13 +188,13 @@ namespace eosiosystem { check( !proxy || !voter->is_proxy, "account registered as a proxy is not allowed to use a proxy" ); /** - * The first time someone votes we calculate and set last_vote_weight, since they cannot unstake until - * after total_activated_stake hits threshold, we can use last_vote_weight to determine that this is + * The first time someone votes we calculate and set last_vote_weight. Since they cannot unstake until + * after the chain has been activated, we can use last_vote_weight to determine that this is * their first vote and should consider their stake activated. */ - if( voter->last_vote_weight <= 0.0 ) { + if( _gstate.thresh_activated_stake_time == time_point() && voter->last_vote_weight <= 0.0 ) { _gstate.total_activated_stake += voter->staked; - if( _gstate.total_activated_stake >= min_activated_stake && _gstate.thresh_activated_stake_time == time_point() ) { + if( _gstate.total_activated_stake >= min_activated_stake ) { _gstate.thresh_activated_stake_time = current_time_point(); } }