@@ -126,8 +126,16 @@ ACTION decide::withdraw(name voter, asset quantity) {
126126 // transfer to eosio.token
127127 // inline trx requires telos.decide@active to have telos.decide@eosio.code
128128 // TODO: replace with action handler
129- token::transfer_action transfer_act (" eosio.token" _n, { get_self (), active_permission });
130- transfer_act.send (get_self (), voter, quantity, std::string (" Telos Decide Withdrawal" ));
129+ // token::transfer_action transfer_act("eosio.token"_n, { get_self(), active_permission });
130+ // transfer_act.send(get_self(), voter, quantity, std::string("Telos Decide Withdrawal"));
131+
132+ // inline transfer
133+ action (permission_level{get_self (), name (" active" )}, name (" eosio.token" ), name (" transfer" ), make_tuple (
134+ get_self (), // from
135+ voter, // to
136+ quantity, // quantity
137+ std::string (" Telos Decide Withdrawal" ) // memo
138+ )).send ();
131139
132140}
133141
@@ -180,7 +188,10 @@ void decide::catch_transfer(name from, name to, asset quantity, string memo) {
180188 config_singleton configs (get_self (), get_self ().value );
181189 auto config = configs.get ();
182190
183- asset total_transferable = (token::get_balance (" eosio.token" _n, get_self (), TLOS_SYM.code ()) + quantity) - config.total_deposits ;
191+ eosio_accounts_table eosio_accounts (name (" eosio.token" ), get_self ().value );
192+ auto & eosio_acct = eosio_accounts.get (TLOS_SYM.code ().raw (), " tlos balance not found" );
193+
194+ asset total_transferable = (eosio_acct.balance + quantity) - config.total_deposits ;
184195
185196 check (total_transferable >= quantity, " Telos Decide lacks the liquid TLOS to make this transfer" );
186197 }
0 commit comments