Skip to content

Commit

Permalink
Merge pull request #675 from eosnetworkfoundation/yarkin/allow_transf…
Browse files Browse the repository at this point in the history
…er_non_eos_token

[0.6] Allow transfer non-EOS tokens out.
  • Loading branch information
yarkinwho authored Dec 19, 2023
2 parents d1f3c22 + 499c3f0 commit 182354a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,11 +588,13 @@ void evm_contract::handle_evm_transfer(eosio::asset quantity, const std::string&

void evm_contract::transfer(eosio::name from, eosio::name to, eosio::asset quantity, std::string memo) {
assert_unfrozen();
eosio::check(get_code() == token_account && quantity.symbol == token_symbol, "received unexpected token");


// Allow transfer non-EOS tokens out.
if(to != get_self() || from == get_self())
return;

eosio::check(get_code() == token_account && quantity.symbol == token_symbol, "received unexpected token");

if(memo.size() == 42 && memo[0] == '0' && memo[1] == 'x')
handle_evm_transfer(quantity, memo);
else if(!memo.empty() && memo.size() <= 13)
Expand Down

0 comments on commit 182354a

Please sign in to comment.