I have two accounts viz. account1 and account2. I set my contract using account2. Now, I am sending 0.1100 EOS from account2 to account1 as a deferred transaction. I am using the following function which invokes a function transfer
.
void second::send(account_name from , account_name to ,asset quantity,string memo,uint64_t delay) {
eosio::transaction t{};
t.actions.emplace_back(
eosio::permission_level(from, N(active)),
account1,
N(transfer),
std::make_tuple(from,to,quantity,memo)
);
t.delay_sec = delay;
t.send(N(memo), from);
}
I am passing from ,to,quantity and memo to the action send
. If I hard code the value of account1, it works and if I set it to some other account it gives the permission exception.
So, now I am confused how to set the correct permissions.
Thanks