I keep getting the following error:
transaction declares authority '{"actor":"test2","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms, provided permissions [{"actor":"contract","permission":"eosio.code"}], provided keys [], and a delay max limit of 3888000000 ms
{
which is related to the contract not having the users active key to sign the inline transaction on the users behalf, this I already know. My inline contract is basically identical to the rex contract but instead of eosio.token, it's using a similar custom token contract with it's transfer method, which is identical to the eosio.token contract.
However when I look at the rex contract's deposit function it is using an inline transaction to take tokens as a payment:
/**
* @brief Deposits core tokens to user REX fund
*
* @param owner - REX fund owner
* @param amount - amount of tokens to be deposited
*/
void system_contract::deposit( const name& owner, const asset& amount )
{
require_auth( owner );
check( amount.symbol == core_symbol(), "must deposit core token" );
check( 0 < amount.amount, "must deposit a positive amount" );
// inline transfer from owner's token balance
{
token::transfer_action transfer_act{ token_account, { owner, active_permission } };
transfer_act.send( owner, rex_account, amount, "deposit to REX fund" );
}
transfer_to_fund( owner, amount );
}
What is the rex contract doing that allows it to remove tokens from the user in an inline transaction?