報錯內容爲:
{"code":500,"message":"Internal Service Error","error":{"code":3090003,"name":"unsatisfied_authorization","what":"Provided keys, permissions, and delays do not satisfy declared authorizations","details":[{"message":"transaction declares authority '{\"actor\":\"wangkes12345\",\"permission\":\"active\"}', but does not have signatures for it under a provided delay of 0 ms, provided permissions [{\"actor\":\"wangkes12345\",\"permission\":\"eosio.code\"}], provided keys [], and a delay max limit of 3888000000 ms","file":"authorization_manager.cpp","line_number":520,"method":"check_authorization"},{"message":"pending console output: ","file":"apply_context.cpp","line_number":72,"method":"exec_one"}]}}
執行EOS合約函數中調用了其他合約,例如我的合約裏面使用了合約調用合約轉賬
這個時候需要給eosio.code權限
解決方案:
cleos set account permission <YOUR_ACCOUNT> active '{"threshold": 1,"keys": [{"key": "<YOUR_PUBLIC_KEY>","weight": 1}],"accounts": [{"permission":{"actor":"<CONTRACT_ACCOUNT>","permission":"eosio.code"},"weight":1}]}' owner -p <YOUR_ACCOUNT>
EOS技術學習羣: 791420381, 太菜沒技術的就不要加了[摳鼻]