Here is my code:
void play(account_name player, asset amount) {
require_auth(player);
//The part that is throwing the error
action {
permission_level{player, N(active)}, //Using the passed in `player` account as ther permission
N(eosio.token),
N(transfer),
currency::transfer {
.from=player, .to=_self, .quantity=amount, .memo="Deposit"
}
}.send();
}
When I call the function using:
cleos push action mycontract deposit '["myaccount", "30 EOS"]' -p myaccount
This is the error I get:
3192155ms thread-0 http_plugin.cpp:406 handle_exception ] Exception Details: 3090003 unsatisfied_authorization: provided keys, permissions, and delays do not satisfy declared authorizations
transaction declares authority '{"actor":"myaccount","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms, provided permissions [{"actor":"myaccount","permission":"eosio.code"}], and provided keys []
{"auth":{"actor":"myaccount","permission":"active"},"provided_delay":0,"provided_permissions":[{"actor":"myaccount","permission":"eosio.code"}],"provided_keys":[],"delay_max_limit_ms":3888000000}
thread-0 authorization_manager.cpp:409 check_authorization
Is there a way to perform this action with passed in account_name
's as the permission?
How would the behavior need to be changed if I deploy this contract to the mainnet?