From 499c3f09d715e2d5c96212e91b88a80df1a16d7d Mon Sep 17 00:00:00 2001 From: yarkin Date: Fri, 15 Dec 2023 09:24:34 +0800 Subject: [PATCH] Allow transfer non-EOS tokens out. --- src/actions.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/actions.cpp b/src/actions.cpp index a1afe02c..b06c0e17 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -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)