eos icon indicating copy to clipboard operation
eos copied to clipboard

Using eosiocpp -g generated to an empty ABI file

Open eoline7 opened this issue 8 years ago • 27 comments

I run the "eosiocpp -g currency.abi currency.hpp" get currency.abi like this: { "____comment": "This file was generated by eosio-abigen. DO NOT EDIT - 2018-04-03T06:24:59", "types": [], "structs": [], "actions": [], "tables": [] }

currency.hpp copied from eosiolib/currency.hpp What is going wrong?

eoline7 avatar Apr 03 '18 06:04 eoline7

you can try by .cpp.

Lomect avatar Apr 03 '18 06:04 Lomect

.cpp is same result

eoline7 avatar Apr 03 '18 07:04 eoline7

.hpp add code annotation will be ok

such as //@abi action and //@abi table

don't know why.

//@abi action struct PACKED( set_owner ) { account_name owner; uint32_t delay; };

//@abi table struct config { config(){} constexpr static uint64_t key = N(config); account_name owner = 0; uint32_t delay = 0; uint32_t next_id = 0; };

okluoquan avatar Apr 04 '18 00:04 okluoquan

@eoline7 I read the sample then testing

  • https://github.com/EOSIO/eos/blob/master/TUTORIAL.md
  • https://github.com/EOSIO/eos/tree/master/contracts/eosio.token And I think you need to EOSIO_ABI( currency, (create)(issue)(transfer) )

navcsdev avatar Apr 05 '18 09:04 navcsdev

Thanks @okluoquan That work for me ..

farhan19aug avatar Apr 18 '18 08:04 farhan19aug

I am trying to build the included examples and there is no way it is generating the proper ABI file

// file eosio.bios.cpp

#include <eosio.bios.hpp>

EOSIO_ABI( eosio::bios, (setpriv)(setalimits)(setglimits)(setprods)(reqauth) )

now in terminal

$ eosiocpp -o eosio.bios.wast eosio.bios.cpp
$ eosiocpp -g eosio.bios.abi eosio.bios.cpp

and this is the contents of the ABI file

{
  "____comment": "This file was generated by eosio-abigen. DO NOT EDIT - 2018-04-18T21:59:15",
  "types": [],
  "structs": [],
  "actions": [],
  "tables": [],
  "ricardian_clauses": []
}

please tell me what is wrong in there and how to correct the issue

anantanandgupta avatar Apr 18 '18 22:04 anantanandgupta

@anantanandgupta try to push your contract into eos project source contracts folder, and run eosiocpp -g again.

x2x4com avatar Apr 25 '18 17:04 x2x4com

@x2x4com I have not moved the contract from there ... the code I am building is still in that source folder.

anantanandgupta avatar Apr 25 '18 20:04 anantanandgupta

Edit: This is now working for me in the latest version.

Original comment: @anantanandgupta I'm experiencing the same issue. I'm also running eosiocpp -g in the project source directory (after having built/installed the latest master branch as of this morning), on the existing example contracts, and it's generating the same "blank" abi file. Even the simple hello contract. Not sure how to trace the issue though, since there are no error messages output during the process (with the exception of a warning regarding missing ricardian clauses)

Codegnosis avatar May 01 '18 11:05 Codegnosis

I'm having the same issue but it work fine with using @//abi action. eosio_abi is not working and because of that it generate always empty abi and all example smart contract use the eosio_abi.

farhan19aug avatar May 07 '18 06:05 farhan19aug

+1

ghost avatar May 16 '18 08:05 ghost

image

ghost avatar May 16 '18 08:05 ghost

image

ghost avatar May 16 '18 08:05 ghost

nothing worked for me. My currency folder is inside contracts folder, not inside eos.bios. I also get empty abi file!

deba10106 avatar May 28 '18 02:05 deba10106

I had the same issue, moving my contract to eos/contracts/my_contract works for me.

Joelone avatar Jun 07 '18 18:06 Joelone

I have come into the same problem for empty abi file, have anyone solved the problem? Thanks!

chenguo-github avatar Jun 11 '18 17:06 chenguo-github

Same issue here - empty abi with "eosiocpp -g eosio.token.abi eosio.token.cpp" and "eosiocpp -g eosio.token.abi eosio.token.hpp" - no error message. Any solution?

svenpohl avatar Jun 12 '18 10:06 svenpohl

What is the cause of this issue? I have tried all solutions mentioned but no luck.

dominic-healid avatar Jun 26 '18 01:06 dominic-healid

code annotation worked for me....

such as //@abi action and //@abi table

Thanks to @okluoquan

JohnnyZhao avatar Jun 30 '18 16:06 JohnnyZhao

currency.hpp is no longer available so I'm going to close this issue. To be able to use eosiocpp, you need //@abi annotation and also EOSIO_ABI by the way.

andriantolie avatar Jul 03 '18 09:07 andriantolie