Skip to content

Commit

Permalink
add more strict logic to ibc_cash_to_hub()
Browse files Browse the repository at this point in the history
  • Loading branch information
justfortest2 committed Apr 9, 2020
1 parent 05cb531 commit 5a79f06
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ibc.token/src/ibc.token.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,13 @@ namespace eosio {
eosio_assert( diff >= 0 && diff < quantity.amount, "diff >= 0 && diff < quantity.amount assert failed");
asset mini_to_quantity{quantity.amount - diff, quantity.symbol};

eosio_assert( mini_to_quantity >= acpt.min_once_transfer, "mini_to_quantity >= acpt.min_once_transfer assert failed" );

auto ptr = _stats.find(quantity.symbol.code().raw());
if ( ptr != _stats.end() ){
eosio_assert( mini_to_quantity >= ptr->min_once_withdraw, "mini_to_quantity >= ptr->min_once_withdraw assert failed" );
}

/// record to hub table
auto _hubtrxs = hubtrxs_table( _self, _self.value );
_hubtrxs.emplace( _self, [&]( auto& r ) {
Expand Down

0 comments on commit 5a79f06

Please sign in to comment.