0

Update 12/17/18:

I solved this by updating my CDT to latest. Still unsure what the issue was.


OS: Windows with Linux/Ubuntu Sub Module

Nodeos: v1.5

CDT: v1.3.2


So I'm trying to set a simple contract.

Contract:

#include <eosiolib/eosio.hpp>
#include <string>

using namespace eosio;

class [[eosio::contract]] hello : public eosio::contract {
  public:
   using contract::contract;

   hello(name receiver, name code,  datastream<const char*> ds): contract(receiver, code, ds) {}

      [[eosio::action]]
      void hi( name user ) {
         require_recipient(user);
      }
};

EOSIO_DISPATCH( hello, (hi))

Compile contract command used:

eosio-cpp -o hello.wasm hello.cpp --abigen
Warning, empty ricardian clause file
Warning, empty ricardian clause file
Warning, action <hi> does not have a ricardian contract

ABI:

{
    "____comment": "This file was generated with eosio-abigen. DO NOT EDIT Fri Dec 14 06:53:47 2018",
    "version": "eosio::abi/1.1",
    "structs": [
        {
            "name": "hi",
            "base": "",
            "fields": [
                {
                    "name": "user",
                    "type": "name"
                }
            ]
        }
    ],
    "types": [],
    "actions": [
        {
            "name": "hi",
            "type": "hi",
            "ricardian_contract": ""
        }
    ],
    "tables": [],
    "ricardian_clauses": [],
    "variants": [],
    "abi_extensions": []
}

And I'm getting the error:

Failed to get existing code hash, continue without duplicate check...
Reading WASM from /mnt/c/Workspaces/new_eos/my_contracts/hello/hello.wasm...
Publishing contract...
Error 3090003: Provided keys, permissions, and delays do not satisfy declared authorizations

However, I have both the eosio key and the host contract's key in my wallet.

enter image description here

Here's the succesful command coming back from creating the account:

cleos create account eosio hellohellohe EOS8gG7oywSuTFBZ6aYqLUKkz4dfJbjBUbieVhzM7EVamoUGLnW2u EOS8gG7oywSuTFBZ6aYqLUKkz4dfJbjBUbieVhzM7EVamoUGLnW2u
executed transaction: 76157e4c6d965e48fb9713eb8c3b3f431825059e5c6bd887b8df847cc44893d0  200 bytes  256 us
#         eosio <= eosio::newaccount            {"creator":"eosio","name":"hellohellohe","owner":{"threshold":1,"keys":[{"key":"EOS8gG7oywSuTFBZ6aYq...
warning: transaction executed locally, but may not be confirmed by the network yet         ]

Full request/response and cleos call:

  • POST /v1/chain/get_code_hash HTTP/1.0
  • RESPONSE: Code 500 Internal Service Error "Failed to get existing code hash, continue without duplicate check... Reading WASM from /mnt/c/Workspaces/new_eos/my_contracts/hello/hello.wasm... Publishing contract..."
  • POST /v1/chain/get_info HTTP/1.0 RES: Looks good there
  • POST /v1/wallet/get_public_keys HTTP/1.0 RES: Looks good there, got the keys
  • POST /v1/chain/get_required_keys HTTP/1.0 with really big data object

cleos --print-request --print-response  set contract hellohellohe hello hello.wasm hello.abi -p hellohellohe

REQUEST:

POST /v1/chain/get_code_hash HTTP/1.0
Host: 127.0.0.1:8888
content-length: 36
Accept: */*
Connection: close

{
  "account_name": "hellohellohe"
}

RESPONSE:

{
  "code": 500,
  "message": "Internal Service Error",
  "error": {
    "code": 0,
    "name": "exception",
    "what": "unspecified",
    "details": []
  }
}

Failed to get existing code hash, continue without duplicate check...
Reading WASM from /mnt/c/Workspaces/new_eos/my_contracts/hello/hello.wasm...
Publishing contract...
REQUEST:

POST /v1/chain/get_info HTTP/1.0
Host: 127.0.0.1:8888
content-length: 0
Accept: */*
Connection: close


RESPONSE:

{
  "server_version": "ea08cfd3",
  "chain_id": "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f",
  "head_block_num": 4399,
  "last_irreversible_block_num": 4398,
  "last_irreversible_block_id": "0000112e58be9d3e943c2a0f40437a0ea031aecb2f97b1cf79dd94b999f09250",
  "head_block_id": "0000112fdbfe196288eafc1b3a0909190d2f97d6ec4d501d4bbcd81cb653477c",
  "head_block_time": "2018-12-14T11:48:56.500",
  "head_block_producer": "eosio",
  "virtual_block_cpu_limit": 16253004,
  "virtual_block_net_limit": 85384710,
  "block_cpu_limit": 199900,
  "block_net_limit": 1048576,
  "server_version_string": "v1.5.0"
}
---------------------
REQUEST:
---------------------
POST /v1/wallet/get_public_keys HTTP/1.0
Host: /home/natanaelprudhomme/eosio-wallet/keosd.sock:
content-length: 0
Accept: */*
Connection: close



RESPONSE:

[
  "EOS5QaqpbQtA98cBbYwhK49wdm2Qdhf7x4hYHb9WkvrSLUNxWm995",
  "EOS5WgXLzLwTXKeRGQV3BSn1saGtT4bkA8jbfLc4L1uTPb9sN6UAw",
  "EOS63zNBrWgKWp2P9pqL5vvKWRdUtJX9tznamw8MkxVSeMGgWYVD5",
  "EOS67wLi78ak2fqffpvGedNqRTEcEeNTZhKBxM3n3cgjBwGerEZgv",
  "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
  "EOS7dsJbPAhRCjTwPB28nithDunNZ1oCMTNRC8g31Y3oahx3w62z8",
  "EOS7jEjKydV7Ve7KbkLNbC6WYpTEqCy7KU8asuWJNu1e3qsGYmic2",
  "EOS85wQgYFL2GnU368P3PVDShMpcqcXTVd1JpLBNTMt5jMEBUBUhv",
  "EOS8DEzBSBrYTJu5GdnsN5oJm5QHPT4zqgLGcPuZuc8Xgfib31Xux",
  "EOS8gG7oywSuTFBZ6aYqLUKkz4dfJbjBUbieVhzM7EVamoUGLnW2u"
]

REQUEST:

POST /v1/chain/get_required_keys HTTP/1.0
Host: 127.0.0.1:8888
content-length: 11847
Accept: */*
Connection: close

{
  "transaction": {
    "expiration": "2018-12-14T11:49:26",
    "ref_block_num": 4398,
    "ref_block_prefix": 254426260,
    "max_net_usage_words": 0,
    "max_cpu_usage_ms": 0,
    "delay_sec": 0,
    "context_free_actions": [],
    "actions": [{
        "account": "eosio",
        "name": "setcode",
        "authorization": [{
            "actor": "hellohellohe",
            "permission": "active"
          }
        ],
        "data": "a01a8d51351aa36a0000b1280061736d0100000001661260037f7e7f006000006000017f60027f7f017f60027f7f0060037f7f7f017f60017e0060047e7e7e7e017f60057f7e7e7e7e0060027e7e017f60027f7c0060027f7d0060027e7e017c60027e7e017d60037e7e7e0060037e7e7f017f60017f017f60017f000287041c03656e7610616374696f6e5f646174615f73697a65000203656e7610726561645f616374696f6e5f64617461000303656e760c656f73696f5f617373657274000403656e76066d656d637079000503656e7611726571756972655f726563697069656e74000603656e760561626f7274000103656e76066d656d736574000503656e76076d656d6d6f7665000503656e76087072696e74735f6c000403656e760a5f5f756e6f7264746632000703656e76075f5f6571746632000703656e76085f5f6d756c746633000803656e76085f5f616464746633000803656e76085f5f737562746633000803656e76075f5f6e65746632000703656e760c5f5f666978756e7374667369000903656e760d5f5f666c6f6174756e73697466000403656e76095f5f66697874667369000903656e760b5f5f666c6f617473697466000403656e760d5f5f657874656e646466746632000a03656e760d5f5f657874656e647366746632000b03656e76085f5f646976746633000803656e76075f5f6c65746632000703656e760c5f5f7472756e637466646632000c03656e76075f5f6765746632000703656e760c5f5f7472756e637466736632000d03656e76207365745f626c6f636b636861696e5f706172616d65746572735f7061636b6564000403656e76206765745f626c6f636b636861696e5f706172616d65746572735f7061636b65640003031c1b010e000f03030410101111030304041103041102110503100310110405017001020205030100010616037f014180c0000b7f0041c082010b7f0041c082010b07ad010c066d656d6f727902000b5f5f686561705f6261736503010a5f5f646174615f656e640302056170706c79001d065f5a646c50760025055f5a6e776a0023055f5a6e616a0024065f5a646150760026145f5a6e776a53743131616c69676e5f76616c5f740027145f5a6e616a53743131616c69676e5f76616c5f740028155f5a646c507653743131616c69676e5f76616c5f740029155f5a6461507653743131616c69676e5f76616c5f74002a0907010041010b011e0ac9201b02000b5501017f230041106b22032400101c024020012000520d0020024280808080808080c0eb00520d002003410036020c2003410136020820032003290308370300200120012003101f1a0b41001030200341106a24000b0600200110040bb30402077f017e23004190016b2203210420032400200228020421052002280200210641002102024010002207450d00024002402007418104490d002007103321020c010b20032007410f6a4170716b220224000b2002200710011a0b200441d8006a410036020020044200370348200442003703502004200220076a36024020042002360238200741074b4180c0001002200441c8006a2002410810031a2004200241086a36023c200441386a200441c8006a41086a220810201a200441086a41086a2203200428024036020020042004290338370308200441e0006a41086a20032802002203360200200441f0006a41086a2209200336020020042004290308220a3703702004200a37036020044180016a41086a20092802002203360200200441306a200336020020042000370318200420013703202004200429037022003703282004200037038001200441186a20054101756a210320042903482100200441f0006a2008102c210802402005410171450d00200328020020066a28020021060b2003200020044180016a2008102c22052006110000024002400240024002400240024020042d0080014101710d0020042d00704101710d010c020b2005280208102520042d0070410171450d010b200828020810252007418104490d010c020b20074181044f0d010b4101210220042d00504101710d010c020b200210364101210220042d0050410171450d010b200441d8006a280200102520044190016a240020020f0b20044190016a240020020b9d0301067f230041206b2202240020024100360218200242003703102000200241106a10211a024002400240024002400240024002402002280214200228021022036b2204450d00200241086a410036020020024200370300200441704f0d052004410a4b0d01200220044101743a0000200241017221050c020b20012d00004101710d02200141003b0100200141086a21030c030b200441106a4170712206102321052002200641017236020020022005360208200220043602040b20042107200521060340200620032d00003a0000200641016a2106200341016a21032007417f6a22070d000b200520046a41003a00000240024020012d00004101710d00200141003b01000c010b200128020841003a0000200141003602040b20014100102d200141086a200241086a2802003602002001200229030037020020022802102203450d040c030b200128020841003a000020014100360204200141086a21030b20014100102d2003410036020020014200370200200228021022030d010c020b2002102b000b20022003360214200310250b200241206a240020000b860203027f017e037f200028020421024100210342002104200041086a2105200041046a2106034020022005280200494185c0001002200628020022022d000021072006200241016a22023602002004200741ff0071200341ff0171220374ad842104200341076a21032007418001710d000b0240024020012802042203200128020022076b22052004a722064f0d002001200620056b1022200041046a2802002102200141046a2802002103200128020021070c010b200520064d0d00200141046a200720066a22033602000b200041086a28020020026b200320076b22024f4180c00010022007200041046a2203280200200210031a2003200328020020026a36020020000bbe0201067f0240024002400240024020002802082202200028020422036b20014f0d002003200028020022046b220520016a2206417f4c0d0241ffffffff0721070240200220046b220241feffffff034b0d0020062002410174220220022006491b2207450d020b2007102321020c030b200041046a21000340200341003a00002000200028020041016a22033602002001417f6a22010d000c040b0b41002107410021020c010b2000102e000b200220076a2107200320016a20046b2104200220056a220521030340200341003a0000200341016a21032001417f6a22010d000b200220046a21042005200041046a2206280200200028020022016b22036b2102024020034101480d0020022001200310031a200028020021010b2000200236020020062004360200200041086a20073602002001450d00200110250f0b0b3801027f02402000410120001b2201103322000d0003404100210041002802e0402202450d012002110100200110332200450d000b0b20000b0600200010230b0e0002402000450d00200010360b0b0600200010250b6b01027f230041106b2202240002402002410c6a20014104200141044b1b22012000410120001b22031031450d000240034041002802e0402200450d0120001101002002410c6a2001200310310d000c020b0b2002410036020c0b200228020c2100200241106a240020000b08002000200110270b0e0002402000450d00200010360b0b08002000200110290b05001005000bc20101037f20004200370200200041086a22024100360200024020012d00004101710d00200020012902003702002002200141086a28020036020020000f0b02402001280204220241704f0d0020012802082103024002402002410b4f0d00200020024101743a0000200041016a210120020d01200120026a41003a000020000f0b200241106a4170712204102321012000200441017236020020002001360208200020023602040b20012003200210031a200120026a41003a000020000f0b1005000bf00201077f0240024002400240200141704f0d000240024020002d000022024101710d0020024101762103410a21040c010b20002802002202417e71417f6a2104200028020421030b410a2105024020032001200320014b1b2201410b490d00200141106a417071417f6a21050b02400240024020052004460d0002402005410a470d0041012106200041016a210120002802082104410021074101210820024101710d030c050b200541016a10232101200520044b0d0120010d010b0f0b024020002d000022024101710d0041012107200041016a210441002106410121082002410171450d030c010b200028020821044101210641012107410121082002410171450d020b200028020441016a2202450d030c020b1005000b200241fe017120087641016a2202450d010b20012004200210031a0b02402006450d00200410250b02402007450d0020002003360204200020013602082000200541016a4101723602000f0b200020034101743a00000b05001005000b060041e4c0000b02000b3301017f411621030240024020014104490d002001200210322201450d0120002001360200410021030b20030f0b102f2802000bf50101067f4100210202400240410020006b22032000712000470d00200041104b0d01200110330f0b102f411636020041000f0b0240024002402000417f6a220420016a10332200450d002000200420006a2003712202460d012000417c6a220328020022044107712201450d02200020044178716a220441786a2205280200210620032001200220006b2207723602002002417c6a200420026b2203200172360200200241786a2006410771220120077236020020052001200372360200200010360b20020f0b20000f0b200241786a200041786a280200200220006b22006a3602002002417c6a200328020020006b36020020020b0a0041f4c000200010340bcd04010c7f02402001450d00024020002802c04122020d0041102102200041c0c1006a41103602000b200141086a200141046a41077122036b200120031b210302400240024020002802c441220420024f0d0020002004410c6c6a4180c0006a2101024020040d0020004184c0006a22022802000d0020014180c000360200200220003602000b200341046a2104034002402001280208220220046a20012802004b0d00200128020420026a2202200228020041808080807871200372360200200141086a2201200128020020046a3602002002200228020041808080807872360200200241046a22010d030b2000103522010d000b0b41fcffffff0720036b2105200041c8c1006a2106200041c0c1006a210720002802c84122082102034020002002410c6c6a22014188c0006a28020020014180c0006a2209280200464189c000100220014184c0006a280200220a41046a21020340200a20092802006a210b2002417c6a220c280200220d41ffffffff077121010240200d4100480d000240200120034f0d000340200220016a2204200b4f0d01200428020022044100480d012001200441ffffffff07716a41046a22012003490d000b0b200c2001200320012003491b200d41808080807871723602000240200120034d0d00200220036a200520016a41ffffffff07713602000b200120034f0d040b200220016a41046a2202200b490d000b4100210120064100200628020041016a220220022007280200461b220236020020022008470d000b0b20010f0b200c200c2802004180808080787236020020020f0b41000b990501087f20002802c44121010240024041002d00ec40450d0041002802f04021020c010b3f002102410041013a00ec404100200241107422023602f0400b200221030240024002400240200241ffff036a41107622043f0022054d0d00200420056b40001a4100210520043f00470d0141002802f04021030b41002105410020033602f04020024100480d002001410c6c210402400240200241ffff037122054180f8034b0d002002418080046a20056b21050c010b2002418080086a200241ffff07716b21050b200020046a2104200520026b2102024041002d00ec400d003f002103410041013a00ec404100200341107422033602f0400b20044180c0006a210420024100480d01200321060240200241076a417871220720036a41ffff036a41107622053f0022084d0d00200520086b40001a20053f00470d0241002802f04021060b4100200620076a3602f0402003417f460d0120002001410c6c6a22014184c0006a2802002206200428020022056a2003460d020240200520014188c0006a22072802002201460d00200620016a2206200628020041808080807871417c20016b20056a72360200200720042802003602002006200628020041ffffffff07713602000b200041c4c1006a2204200428020041016a220436020020002004410c6c6a22004180c0006a2205200236020020004184c0006a20033602000b20050f0b02402004280200220520002001410c6c6a22034188c0006a22012802002202460d0020034184c0006a28020020026a2203200328020041808080807871417c20026b20056a72360200200120042802003602002003200328020041ffffffff07713602000b2000200041c4c1006a220228020041016a22033602c0412002200336020041000f0b2004200520026a36020020040b7c01037f024002402000450d0041002802b4820122014101480d0041f4800121022001410c6c41f480016a21030340200241046a2802002201450d010240200141046a20004b0d00200120022802006a20004b0d030b2002410c6a22022003490d000b0b0f0b2000417c6a2202200228020041ffffffff07713602000b0b6e02004180c0000b057265616400004185c0000b5a676574006d616c6c6f635f66726f6d5f6672656564207761732064657369676e656420746f206f6e6c792062652063616c6c6564206166746572205f686561702077617320636f6d706c6574656c7920616c6c6f636174656400"
      },{
        "account": "eosio",
        "name": "setabi",
        "authorization": [{
            "actor": "hellohellohe",
            "permission": "active"
          }
        ],
        "data": "a01a8d51351aa36a3e0e656f73696f3a3a6162692f312e31000102686900020475736572046e616d65046e616d6506737472696e6701000000000000806b026869000000000000"
      }
    ],
    "transaction_extensions": []
  },
  "available_keys": [
    "EOS5QaqpbQtA98cBbYwhK49wdm2Qdhf7x4hYHb9WkvrSLUNxWm995",
    "EOS5WgXLzLwTXKeRGQV3BSn1saGtT4bkA8jbfLc4L1uTPb9sN6UAw",
    "EOS63zNBrWgKWp2P9pqL5vvKWRdUtJX9tznamw8MkxVSeMGgWYVD5",
    "EOS67wLi78ak2fqffpvGedNqRTEcEeNTZhKBxM3n3cgjBwGerEZgv",
    "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
    "EOS7dsJbPAhRCjTwPB28nithDunNZ1oCMTNRC8g31Y3oahx3w62z8",
    "EOS7jEjKydV7Ve7KbkLNbC6WYpTEqCy7KU8asuWJNu1e3qsGYmic2",
    "EOS85wQgYFL2GnU368P3PVDShMpcqcXTVd1JpLBNTMt5jMEBUBUhv",
    "EOS8DEzBSBrYTJu5GdnsN5oJm5QHPT4zqgLGcPuZuc8Xgfib31Xux",
    "EOS8gG7oywSuTFBZ6aYqLUKkz4dfJbjBUbieVhzM7EVamoUGLnW2u"
  ]
}

RESPONSE:

{
  "code": 401,
  "message": "UnAuthorized",
  "error": {
    "code": 3090003,
    "name": "unsatisfied_authorization",
    "what": "Provided keys, permissions, and delays do not satisfy declared authorizations",
    "details": []
  }
}

Thank you!

  • Try this command to create account...may be this can remove your error....cleos set account permission <your-account-name> active '{"threshold":1,"keys":[{"key":"<you-public-eos-key>","weight":1}],"accounts":[{"permission":{"actor":"<your-account-name>","permission":"eosio.code"},"weight":1}]}' owner -p <your-account-name>@owner – Mr.Y Dec 14 '18 at 13:13
  • *to set permissions not to create account – Mr.Y Dec 14 '18 at 13:19
  • Sorry I didn't get around to testing that. Also, theres a much easier way to set code now: cleos set account permission addressbook active --add-code developers.eos.io/eosio-home/docs/inline-actions – Nat Dec 17 '18 at 14:01
0

I don't think its a permission issue or @eosio.code issue(especially if the contract isn't published)

Maybe you could try something like this in cleos?

cleos --print-request --print-response set contract hellohellohe hello.wasm hello.abi -p hellohellohe@active

or

cleos --print-request --print-response set contract hellohellohe /directory/of/hello -p hellohellohe@active

|improve this answer|||||
  • I updated and the problem went away. Thank you for your answer. – Nat Dec 17 '18 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.