eoscostarica / eos-rate

EOS Block Producer Ratings and Voting Portal :star2:
https://eosrate.io
MIT License
27 stars 27 forks source link

Restrict Rating to accounts with more than 21 votes #237

Closed xavier506 closed 4 years ago

xavier506 commented 4 years ago

As a ratings user my account should have voted for more than 21 BPs in order to be allowed to rate block producers on EOS rate in order to help prevent SPAM and allow only users that have taken the time to inform themselves and vote.

EOSIO Rex contract has some logic to check voting requirements

https://github.com/EOSIO/eosio.contracts/blob/636406b45a4e1d4c3d7b308f6064dfe61b962814/contracts/eosio.system/src/rex.cpp#L421

 /**
    * @brief Checks if account satisfies voting requirement (voting for a proxy or 21 producers)
    * for buying REX
    *
    * @param owner - account buying or already holding REX tokens
    * @err_msg - error message
    */
   void system_contract::check_voting_requirement( const name& owner, const char* error_msg )const
   {
      auto vitr = _voters.find( owner.value );
      check( vitr != _voters.end() && ( vitr->proxy || 21 <= vitr->producers.size() ), error_msg );
   }
xavier506 commented 4 years ago

What about accounts that vote for proxies? Should those be allowed to vote?

Proxies accounts should be allowed to vote also since they are supposed to be informed voters.

see issue #139 : restrict rating to proxy accounts for v1

along with PR #176

xavier506 commented 4 years ago

EOSIO Rex contract has some logic to check voting requirements

https://github.com/EOSIO/eosio.contracts/blob/636406b45a4e1d4c3d7b308f6064dfe61b962814/contracts/eosio.system/src/rex.cpp#L421

 /**
    * @brief Checks if account satisfies voting requirement (voting for a proxy or 21 producers)
    * for buying REX
    *
    * @param owner - account buying or already holding REX tokens
    * @err_msg - error message
    */
   void system_contract::check_voting_requirement( const name& owner, const char* error_msg )const
   {
      auto vitr = _voters.find( owner.value );
      check( vitr != _voters.end() && ( vitr->proxy || 21 <= vitr->producers.size() ), error_msg );
   }
kriskoin commented 4 years ago

Done

kriskoin commented 4 years ago

@xavier506 @rubenabix the branch "21voters" fix this issue

kriskoin commented 4 years ago

the commit a0bf27e45e172a763248896a8e6f842c759eb218 fix the 21 voters issue