Skip to content

Commit

Permalink
disabled rex and name bid actions (#86)
Browse files Browse the repository at this point in the history
* added check guards that disallows rex and name bidding actions
  • Loading branch information
mark-tsyrulnyk authored Oct 25, 2019
1 parent 67eb65f commit 1d1d00d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contracts/contracts/rem.system/src/name_bidding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ namespace eosiosystem {
using eosio::token;

void system_contract::bidname( const name& bidder, const name& newname, const asset& bid ) {
check( false, "name auction is not supported" );

require_auth( bidder );
check( newname.suffix() == newname, "you can only bid on top-level suffix" );

Expand Down Expand Up @@ -68,6 +70,8 @@ namespace eosiosystem {
}

void system_contract::bidrefund( const name& bidder, const name& newname ) {
check( false, "name auction is not supported" );

bid_refund_table refunds_table(get_self(), newname.value);
auto it = refunds_table.find( bidder.value );
check( it != refunds_table.end(), "refund not found" );
Expand Down
38 changes: 38 additions & 0 deletions contracts/contracts/rem.system/src/rex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ namespace eosiosystem {

void system_contract::deposit( const name& owner, const asset& amount )
{
check( false, "REX is not supported" );

require_auth( owner );

check( amount.symbol == core_symbol(), "must deposit core token" );
Expand All @@ -23,6 +25,8 @@ namespace eosiosystem {

void system_contract::withdraw( const name& owner, const asset& amount )
{
check( false, "REX is not supported" );

require_auth( owner );

check( amount.symbol == core_symbol(), "must withdraw core token" );
Expand All @@ -38,6 +42,8 @@ namespace eosiosystem {

void system_contract::buyrex( const name& from, const asset& amount )
{
check( false, "REX is not supported" );

require_auth( from );

check( amount.symbol == core_symbol(), "asset must be core token" );
Expand All @@ -55,6 +61,8 @@ namespace eosiosystem {

void system_contract::unstaketorex( const name& owner, const name& receiver, const asset& from_net, const asset& from_cpu )
{
check( false, "REX is not supported" );

require_auth( owner );

check( from_net.symbol == core_symbol() && from_cpu.symbol == core_symbol(), "asset must be core token" );
Expand Down Expand Up @@ -95,6 +103,8 @@ namespace eosiosystem {

void system_contract::sellrex( const name& from, const asset& rex )
{
check( false, "REX is not supported" );

require_auth( from );

runrex(2);
Expand Down Expand Up @@ -145,6 +155,8 @@ namespace eosiosystem {

void system_contract::cnclrexorder( const name& owner )
{
check( false, "REX is not supported" );

require_auth( owner );

auto itr = _rexorders.require_find( owner.value, "no sellrex order is scheduled" );
Expand All @@ -154,6 +166,8 @@ namespace eosiosystem {

void system_contract::rentcpu( const name& from, const name& receiver, const asset& loan_payment, const asset& loan_fund )
{
check( false, "REX is not supported" );

require_auth( from );

rex_cpu_loan_table cpu_loans( get_self(), get_self().value );
Expand All @@ -163,6 +177,8 @@ namespace eosiosystem {

void system_contract::rentnet( const name& from, const name& receiver, const asset& loan_payment, const asset& loan_fund )
{
check( false, "REX is not supported" );

require_auth( from );

rex_net_loan_table net_loans( get_self(), get_self().value );
Expand All @@ -172,6 +188,8 @@ namespace eosiosystem {

void system_contract::fundcpuloan( const name& from, uint64_t loan_num, const asset& payment )
{
check( false, "REX is not supported" );

require_auth( from );

rex_cpu_loan_table cpu_loans( get_self(), get_self().value );
Expand All @@ -180,6 +198,8 @@ namespace eosiosystem {

void system_contract::fundnetloan( const name& from, uint64_t loan_num, const asset& payment )
{
check( false, "REX is not supported" );

require_auth( from );

rex_net_loan_table net_loans( get_self(), get_self().value );
Expand All @@ -188,6 +208,8 @@ namespace eosiosystem {

void system_contract::defcpuloan( const name& from, uint64_t loan_num, const asset& amount )
{
check( false, "REX is not supported" );

require_auth( from );

rex_cpu_loan_table cpu_loans( get_self(), get_self().value );
Expand All @@ -196,6 +218,8 @@ namespace eosiosystem {

void system_contract::defnetloan( const name& from, uint64_t loan_num, const asset& amount )
{
check( false, "REX is not supported" );

require_auth( from );

rex_net_loan_table net_loans( get_self(), get_self().value );
Expand All @@ -204,6 +228,8 @@ namespace eosiosystem {

void system_contract::updaterex( const name& owner )
{
check( false, "REX is not supported" );

require_auth( owner );

runrex(2);
Expand All @@ -230,6 +256,8 @@ namespace eosiosystem {

void system_contract::setrex( const asset& balance )
{
check( false, "REX is not supported" );

require_auth( "rem"_n );

check( balance.amount > 0, "balance must be set to have a positive amount" );
Expand All @@ -242,13 +270,17 @@ namespace eosiosystem {

void system_contract::rexexec( const name& user, uint16_t max )
{
check( false, "REX is not supported" );

require_auth( user );

runrex( max );
}

void system_contract::consolidate( const name& owner )
{
check( false, "REX is not supported" );

require_auth( owner );

runrex(2);
Expand All @@ -260,6 +292,8 @@ namespace eosiosystem {

void system_contract::mvtosavings( const name& owner, const asset& rex )
{
check( false, "REX is not supported" );

require_auth( owner );

runrex(2);
Expand Down Expand Up @@ -294,6 +328,8 @@ namespace eosiosystem {

void system_contract::mvfrsavings( const name& owner, const asset& rex )
{
check( false, "REX is not supported" );

require_auth( owner );

runrex(2);
Expand All @@ -317,6 +353,8 @@ namespace eosiosystem {

void system_contract::closerex( const name& owner )
{
check( false, "REX is not supported" );

require_auth( owner );

if ( rex_system_initialized() )
Expand Down

0 comments on commit 1d1d00d

Please sign in to comment.