Eos: "dice" contract "withdraw" action problem

Created on 16 Jun 2018  路  6Comments  路  Source: EOSIO/eos

I have issues with using "dice" contract on my local tesnet. I've setup up all necessary contracts and could deposit assets to the "dice" contract, but when I try to withdraw funds I get the following error:

Error 3090003: provided keys, permissions, and delays do not satisfy declared authorizations
Ensure that you have the related private keys inside your wallet and your wallet is unlocked.

And here are messages from nodeos:

2757860ms thread-0   http_plugin.cpp:405           handle_exception     ] FC Exception encountered while processing chain.push_transaction
2757860ms 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":"dice","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms, provided permissions [{"actor":"dice","permission":"eosio.code"}], and provided keys []
    {"auth":{"actor":"dice","permission":"active"},"provided_delay":0,"provided_permissions":[{"actor":"dice","permission":"eosio.code"}],"provided_keys":[],"delay_max_limit_ms":3888000000}
    thread-0  authorization_manager.cpp:409 check_authorization
{"_pending_console_output.str()":""}
thread-0  apply_context.cpp:62 exec_one

setup_dice.txt - script to setup "dice" contract (all keys are uploaded to the wallet and it is unlocked)
Version of the EOS is 1.0.5, but the same was for v1.0.2

Support

Most helpful comment

as explained in the message, you need to add 'eosio.code' permission to dice@active

cleos set account permission dice active '{"threshold": 1,"keys": [{"key": "EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4","weight": 1}],"accounts": [{"permission":{"actor":"dice","permission":"eosio.code"},"weight":1}]}' owner -p dice

All 6 comments

This is my permission command from the script:

cleos set account permission alice active '{"threshold": 1,"keys": [{"key": "EOS5UN5TzsSFSfbdX48MeZrGEywYLPzXNbXd6vbf2frVSsdKp6g1C","weight": 1}],"accounts": [{"permission":{"actor":"dice","permission":"eosio.code"},"weight":1}]}' owner -p alice

so, I'm using "eosio.code"
Isn't this command correct?
In the desciption of "dice" contract it is used

... {"actor":"dice","permission":"active"} ...

but this is not working as well

i have the same problem
eos3@eos3-virtual-machine:~/eos$ cleos push action dice withdraw '[ "alice", "103.0000 SYS" ]' -p alice
Error 3090003: provided keys, permissions, and delays do not satisfy declared authorizations
Ensure that you have the related private keys inside your wallet and your wallet is unlocked.
Error Details:
transaction declares authority '{"actor":"dice","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms, provided permissions [{"actor":"dice","permission":"eosio.code"}], and provided keys []
eos3@eos3-virtual-machine:~/eos$ cleos wallet keys
[
"EOS55UqxQmM1A7Hdfp9kAe9vgHbjJM9iXp7EpCH5sNQier9sAB5gP",
"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4"
]
eos3@eos3-virtual-machine:~/eos$ cleos get account alice
permissions:
owner 1: 1 EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4
active 1: 1 EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC41 [email protected],
memory:
quota: unlimited used: 3.051 Kb

net bandwidth:
used: unlimited
available: unlimited
limit: unlimited

cpu bandwidth:
used: unlimited
available: unlimited
limit: unlimited

eos3@eos3-virtual-machine:~/eos$

why?? thanks

I was having the same problem following the published instructions.

I was able to get a similar contract to work using this value for "set account permission":

cleos set account permission user1 active '{"threshold": 1,"keys": [{"key": "EOS7MQv1nNMv7gmxRKYRvuUVbJCk9hBjqFXjQDavtPNFcfd9YEpSR","weight": 1}],"accounts": [{"permission":{"actor":"bank1","permission":"eosio.code"},"weight":1}]}' owner -p user1

as explained in the message, you need to add 'eosio.code' permission to dice@active

cleos set account permission dice active '{"threshold": 1,"keys": [{"key": "EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4","weight": 1}],"accounts": [{"permission":{"actor":"dice","permission":"eosio.code"},"weight":1}]}' owner -p dice

as explained in the message, you need to add 'eosio.code' permission to dice@active

cleos set account permission dice active '{"threshold": 1,"keys": [{"key": "EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4","weight": 1}],"accounts": [{"permission":{"actor":"dice","permission":"eosio.code"},"weight":1}]}' owner -p dice

Thanks. That worked for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hadramidah picture hadramidah  路  3Comments

IvanYakimov picture IvanYakimov  路  3Comments

xiaomaogy picture xiaomaogy  路  3Comments

hsejin314 picture hsejin314  路  3Comments

yashbhavsar007 picture yashbhavsar007  路  3Comments