diff --git a/README.md b/README.md index 0614839d2..7da24e028 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + # can.contracts ## Version : 1.2.0 diff --git a/contracts/eosio.system/README.md b/contracts/eosio.system/README.md index ac308bcb9..6a2804f8a 100755 --- a/contracts/eosio.system/README.md +++ b/contracts/eosio.system/README.md @@ -73,7 +73,7 @@ The naming convention is codeaccount::actionname followed by a list of paramters - **from** owner account name - **amount** amount of tokens to be used for purchase - 'amount' tokens are taken out of 'from' REX fund. - - User must vote for at least 15 producers or delegate vote to proxy before buying REX. + - User must vote for at least 5 producers or delegate vote to proxy before buying REX. - Tokens used in purchase are added to user's voting power. - Bought REX cannot be sold before 4 days counting from end of day of purchase. - Storage change is billed to 'from' account. @@ -85,7 +85,7 @@ The naming convention is codeaccount::actionname followed by a list of paramters - **receiver** account name that tokens have previously been staked to - **from_net** amount of tokens to be unstaked from NET bandwidth and used for REX purchase - **from_cpu** amount of tokens to be unstaked from CPU bandwidth and used for REX purchase - - User must vote for at least 15 producers or delegate vote to proxy before buying REX. + - User must vote for at least 5 producers or delegate vote to proxy before buying REX. - Tokens used in purchase are added to user's voting power. - Bought REX cannot be sold before 4 days counting from end of day of purchase. - Storage change is billed to 'owner' account. diff --git a/contracts/eosio.system/include/eosio.system/eosio.system.hpp b/contracts/eosio.system/include/eosio.system/eosio.system.hpp index 96daeb2d2..e332272cd 100644 --- a/contracts/eosio.system/include/eosio.system/eosio.system.hpp +++ b/contracts/eosio.system/include/eosio.system/eosio.system.hpp @@ -708,7 +708,7 @@ namespace eosiosystem { * @param amount - amount of tokens taken out of 'from' REX fund. * * @pre A voting requirement must be satisfied before action can be executed. - * @pre User must vote for at least 15 producers or delegate vote to proxy before buying REX. + * @pre User must vote for at least 5 producers or delegate vote to proxy before buying REX. * * @post User votes are updated following this action. * @post Tokens used in purchase are added to user's voting power. @@ -727,7 +727,7 @@ namespace eosiosystem { * @param from_cpu - amount of tokens to be unstaked from CPU bandwidth and used for REX purchase. * * @pre A voting requirement must be satisfied before action can be executed. - * @pre User must vote for at least 15 producers or delegate vote to proxy before buying REX. + * @pre User must vote for at least 5 producers or delegate vote to proxy before buying REX. * * @post User votes are updated following this action. * @post Tokens used in purchase are added to user's voting power. @@ -1233,7 +1233,7 @@ namespace eosiosystem { void update_rex_pool(); void update_resource_limits( const name& from, const name& receiver, int64_t delta_net, int64_t delta_cpu ); void check_voting_requirement( const name& owner, - const char* error_msg = "must vote for at least 15 producers or for a proxy before buying REX" )const; + const char* error_msg = "must vote for at least 5 producers or for a proxy before buying REX" )const; rex_order_outcome fill_rex_order( const rex_balance_table::const_iterator& bitr, const asset& rex ); asset update_rex_account( const name& owner, const asset& proceeds, const asset& unstake_quant, bool force_vote_update = false ); void channel_to_rex( const name& from, const asset& amount ); diff --git a/contracts/eosio.system/ricardian/eosio.system.contracts.md.in b/contracts/eosio.system/ricardian/eosio.system.contracts.md.in index f087c4237..72353f7db 100644 --- a/contracts/eosio.system/ricardian/eosio.system.contracts.md.in +++ b/contracts/eosio.system/ricardian/eosio.system.contracts.md.in @@ -79,7 +79,7 @@ summary: '{{nowrap from}} buys REX tokens in exchange for {{nowrap amount}} and icon: @ICON_BASE_URL@/@REX_ICON_URI@ --- -{{amount}} is taken out of {{from}}’s REX fund and used to purchase REX tokens at the current market exchange rate. In order for the action to succeed, {{from}} must have voted for a proxy or at least 15 block producers. {{amount}} is added to {{from}}’s vote stake. +{{amount}} is taken out of {{from}}’s REX fund and used to purchase REX tokens at the current market exchange rate. In order for the action to succeed, {{from}} must have voted for a proxy or at least 5 block producers. {{amount}} is added to {{from}}’s vote stake. A sell order of the purchased amount can only be initiated after waiting for the maturity period of 4 to 5 days to pass. Even then, depending on the market conditions, the initiated sell order may not be executed immediately. @@ -631,7 +631,7 @@ summary: '{{nowrap owner}} buys REX tokens in exchange for tokens currently stak icon: @ICON_BASE_URL@/@REX_ICON_URI@ --- -{{from_net}} and {{from_cpu}} are withdrawn from {{receiver}}’s NET and CPU bandwidths respectively. These funds are used to purchase REX tokens at the current market exchange rate. In order for the action to succeed, {{owner}} must have voted for a proxy or at least 15 block producers. +{{from_net}} and {{from_cpu}} are withdrawn from {{receiver}}’s NET and CPU bandwidths respectively. These funds are used to purchase REX tokens at the current market exchange rate. In order for the action to succeed, {{owner}} must have voted for a proxy or at least 5 block producers. A sell order of the purchased amount can only be initiated after waiting for the maturity period of 4 to 5 days to pass. Even then, depending on the market conditions, the initiated sell order may not be executed immediately. diff --git a/contracts/eosio.system/src/rex.cpp b/contracts/eosio.system/src/rex.cpp index 6594e4fef..945b2e0f7 100644 --- a/contracts/eosio.system/src/rex.cpp +++ b/contracts/eosio.system/src/rex.cpp @@ -412,7 +412,7 @@ namespace eosiosystem { } /** - * @brief Checks if account satisfies voting requirement (voting for a proxy or 15 producers) + * @brief Checks if account satisfies voting requirement (voting for a proxy or 5 producers) * for buying REX * * @param owner - account buying or already holding REX tokens @@ -421,7 +421,7 @@ namespace eosiosystem { 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 || 15 <= vitr->producers.size() ), error_msg ); + check( vitr != _voters.end() && ( vitr->proxy || 5 <= vitr->producers.size() ), error_msg ); } /** diff --git a/contracts/eosio.system/src/voting.cpp b/contracts/eosio.system/src/voting.cpp index 86df36c38..ed3fb432f 100644 --- a/contracts/eosio.system/src/voting.cpp +++ b/contracts/eosio.system/src/voting.cpp @@ -110,9 +110,9 @@ namespace eosiosystem { using value_type = std::pair; std::vector< value_type > top_producers; - top_producers.reserve(15); + top_producers.reserve(5); - for( auto it = idx.cbegin(); it != idx.cend() && top_producers.size() < 15 && 0 < it->total_votes && it->active(); ++it ) { + for( auto it = idx.cbegin(); it != idx.cend() && top_producers.size() < 5 && 0 < it->total_votes && it->active(); ++it ) { top_producers.emplace_back( eosio::producer_authority{ .producer_name = it->owner, @@ -205,7 +205,7 @@ namespace eosiosystem { update_votes( voter_name, proxy, producers, true ); auto rex_itr = _rexbalance.find( voter_name.value ); if( rex_itr != _rexbalance.end() && rex_itr->rex_balance.amount > 0 ) { - check_voting_requirement( voter_name, "voter holding REX tokens must vote for at least 15 producers or for a proxy" ); + check_voting_requirement( voter_name, "voter holding REX tokens must vote for at least 5 producers or for a proxy" ); } } diff --git a/contracts/eosio.wrap/include/eosio.wrap/eosio.wrap.hpp b/contracts/eosio.wrap/include/eosio.wrap/eosio.wrap.hpp index c6fdbe249..abc1b648b 100644 --- a/contracts/eosio.wrap/include/eosio.wrap/eosio.wrap.hpp +++ b/contracts/eosio.wrap/include/eosio.wrap/eosio.wrap.hpp @@ -11,7 +11,7 @@ namespace eosio { * eosio.wrap contract simplifies Block Producer superuser actions by making them more readable and easier to audit. * It does not grant block producers any additional powers that do not already exist within the - * system. Currently, 15/21 block producers can already change an account's keys or modify an + * system. Currently, 4/5 block producers can already change an account's keys or modify an * account's contract at the request of ECAF or an account's owner. However, the current method * is opaque and leaves undesirable side effects on specific system accounts. * eosio.wrap allows for a cleaner method of implementing these important governance actions.