Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Permission issue for action in contract #3013

Closed
mjshin82 opened this issue May 14, 2018 · 9 comments
Closed

Permission issue for action in contract #3013

mjshin82 opened this issue May 14, 2018 · 9 comments
Milestone

Comments

@mjshin82
Copy link

mjshin82 commented May 14, 2018

Here is my contract code. this contract code make a eosio.token's transfer action like a dice contract sample.

    void hireknight(account_name from, uint64_t type) {
        // ...

        // pay the cost
        action(permission_level{ from, N(active) },
               N(eosio.token), N(transfer),
               std::make_tuple(from, self, price, std::string(""))
        ).send();

       // ...
    }

And then,
Allow ck.code contract to make transfers on mk behalf

eos@ubuntu:~/eosio-wallet$ cleos set account permission mk active '{"threshold": 1,"keys": [{"key": "EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4","weight": 1}],"accounts": [{"permission":{"actor":"ck.code","permission":"active"},"weight":1}]}' owner -p mk

But it brings a permission error.

eos@ubuntu:~/eosio-wallet$ cleos push action ck.code hireknight '["mk", 1]' -p mk
Error 3090003: provided keys, permissions, and delays do not satisfy declared authorizations
Error Details:
transaction declares authority '{"actor":"mk","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms

It run fine on dawn3.0, but not on dawn 4.0

@gpmn
Copy link

gpmn commented May 14, 2018

(>_<)
me too!!!!!!!!!!

@gpmn
Copy link

gpmn commented May 14, 2018

that's my code and test script, asking for help!
so appreciate!

abc.zip

@woshidama323
Copy link

+1

@bytemaster bytemaster added this to the Version 1.0 milestone May 14, 2018
@bytemaster
Copy link
Contributor

We enhanced the security under Dawn 4.0, you need to set the permission level "kc.code@eosio.code" rather than "kc.code@active". Actions dispatched by code are no longer dispatched with "active" authority, but with a special "eosio.code" authority level.

eos@ubuntu:~/eosio-wallet$ cleos set account permission mk active '{"threshold": 1,"keys": [{"key": "EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4","weight": 1}],"accounts": [{"permission":{"actor":"ck.code","permission":"eosio.code"},"weight":1}]}' owner -p mk

Therefore, the issue is a misconfigured authority on account mk.

@chenlian2015
Copy link

@cluestudio
Is the problem really solved? I have a unified problem.

@mjshin82
Copy link
Author

mjshin82 commented May 16, 2018

Yes, It works to me.
from

[{"permission":{"actor":"ck.code","permission":"active"},"weight":1}]

to

[{"permission":{"actor":"ck.code","permission":"eosio.code"},"weight":1}]

@boy-good
Copy link

We enhanced the security under Dawn 4.0, you need to set the permission level "kc.code@eosio.code" rather than "kc.code@active". Actions dispatched by code are no longer dispatched with "active" authority, but with a special "eosio.code" authority level.

eos@ubuntu:~/eosio-wallet$ cleos set account permission mk active '{"threshold": 1,"keys": [{"key": "EOS7ijWCBmoXBi3CgtK7DJxentZZeTkeUnaSDvyro9dq7Sd1C3dC4","weight": 1}],"accounts": [{"permission":{"actor":"ck.code","permission":"eosio.code"},"weight":1}]}' owner -p mk

Therefore, the issue is a misconfigured authority on account mk.

Hello, what i how to solve this problem :
Exception Details: 3050003 eosio_assert_message_exception: eosio_assert_message assertion failure
assertion failure with message: attempt to add asset with different symbol
{"s":"attempt to add asset with different symbol"}

@shawnmuggle
Copy link

{"s":"attempt to add asset with different symbol"}

Are you running on a local node?

The default symbol is SYS on local node, not EOS. Try to use "1.0000 SYS" instead of "1.0000 EOS".

@anqiuy
Copy link

anqiuy commented Mar 1, 2019

This command do same things with bytemaster's description, but brief...
cleos set account permission mk active ck.code --add-code

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants