Closed eoline7 closed 6 years ago
you can try by .cpp.
.cpp is same result
.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; };
@eoline7 I read the sample then testing
EOSIO_ABI( currency, (create)(issue)(transfer) )
Thanks @okluoquan That work for me ..
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 try to push your contract into eos project source contracts folder, and run eosiocpp -g again.
@x2x4com I have not moved the contract from there ... the code I am building is still in that source folder.
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)
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.
+1
nothing worked for me. My currency folder is inside contracts folder, not inside eos.bios. I also get empty abi file!
I had the same issue, moving my contract to eos/contracts/my_contract works for me.
I have come into the same problem for empty abi file, have anyone solved the problem? Thanks!
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?
What is the cause of this issue? I have tried all solutions mentioned but no luck.
code annotation worked for me....
such as //@abi action and //@abi table
Thanks to @okluoquan
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.
And also eosio.token.abi is not generated by eosiocpp. It hasn't been annotated to support eosiocpp :)
Is there anything new? eosiocpp still make empty .abi file on my node...
in my case the actions is the only field that is empty from the ABI file.
Any thoughts?
{
"____comment": "This file was generated by eosio-abigen. DO NOT EDIT - 2018-08-22T07:10:24",
"version": "eosio::abi/1.0",
"types": [],
"structs": [{
"name": "account",
"base": "",
"fields": [{
"name": "balance",
"type": "asset"
}
]
},{
"name": "currency",
"base": "",
"fields": [{
"name": "supply",
"type": "asset"
},{
"name": "max_supply",
"type": "asset"
},{
"name": "issuer",
"type": "name"
}
]
}
],
"actions": [],
"tables": [{
"name": "accounts",
"index_type": "i64",
"key_names": [
"balance"
],
"key_types": [
"asset"
],
"type": "account"
},{
"name": "stat",
"index_type": "i64",
"key_names": [
"supply"
],
"key_types": [
"asset"
],
"type": "currency"
}
],
"ricardian_clauses": [],
"error_messages": [],
"abi_extensions": []
}
some versions of source code generated empty .abi file in the past (they hada bug)...but now they are changing command for compiling....you need to write your own .abi file until they prepare new compiler (url: https://developers.eos.io/eosio-cpp/docs/how-to-write-an-abi - red sector)
i suggest you to compile older version of source code in separate directory- just for compiling...
thanks for the response @nejc-skerjanc
Actually what I did, I manually added the entries for the actions field however I'm still getting an error that says.
Error 3050000: action exception
Error Details:
Unknown action create in contract proposal
even I already have this on my abi file
"actions": [{
"name": "transfer",
"type": "transfer",
"ricardian_contract": ""
},{
"name": "issue",
"type": "issue",
"ricardian_contract": ""
}, {
"name": "create",
"type": "create",
"ricardian_contract": ""
}]
in this abi file also structures/header lines are missed: you should check few abi files in these contracts: https://github.com/EOSIO/eos/tree/master/contracts
docker run --name eos-dev eosio/eos-dev
docker exec eos-dev /bin/bash
# change the path and use the eosiocpp to gen the contracts
cd /eos/contracts
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?