Closed yankunsam closed 6 years ago
I am seeing the same issue when I use eosiocpp -n to create scaffolding and then compile, my abi is flat and wen i set contract it works but can call the action as it is not defined in abi "version": "eosio::abi/1.0", "types": [], "structs": [], "actions": [], "tables": [], "ricardian_clauses": [], "error_messages": [], "abi_extensions": []
Found the issue - use eosiocpp -g beta1.abi beta1.cpp
use cpp file not recommended hpp file as 2nd param
@PatientDirected BY cpp file, also issues:
➜ eosio.system git:(master) ✗ eosiocpp -g eosio.system.abi eosio.system.cpp In file included from /Users/sam/Public/eos/contracts/eosio.system/eosio.system.cpp:4: /Users/sam/Public/eos/contracts/eosio.system/producer_pay.cpp:3:10: fatal error: 'eosio.token/eosio.token.hpp' file not found
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
415302ms thread-0 main.cpp:105 main ] 999999 abi_generation_exception: Unable to generate abi res: {} thread-0 abi_generator.hpp:367 MacroExpands 415302ms thread-0 main.cpp:105 main ] output: {"version":"eosio::abi/1.0","types":[],"structs":[],"actions":[],"tables":[],"ricardian_clauses":[],"error_messages":[],"abi_extensions":[]} ➜ eosio.system git:(master) ✗
@yankunsam
Just edit file "eosio.token.cpp",
replace #include <eosio.token/eosio.token.hpp>
with #include <eosio.token.hpp>
.
please use "eosiocpp -g <abiFile> <cppFile>
to generate abi file. Please notice this method doesn't work with native contract eosio.token.cpp
@taokayan can you provide explanation why is it not working with that contract?
What about for a contract that has the code copied from eosio.token?
@taokayan Sorry for the long time, I write and compile a contract as dice. It works now.
@taokayan Could you explain why eosiocpp -g <abiFile> <cppFile>
doesnt work with the eosio.token.cpp file? I'm encountering the same problem.
➜ eosio.system git:(master) ✗ eosiocpp -g eosio.system.abi eosio.system.hpp 1419166ms thread-0 abi_generator.hpp:68 ricardian_contracts ] Warning, no ricardian clauses found for
1420685ms thread-0 main.cpp:105 main ] 999999 abi_generation_exception: Unable to generate abi false: types can only be: vector, struct, class or a built-in type. (double) {"type":"double"} thread-0 abi_generator.cpp:626 add_type
1420685ms thread-0 main.cpp:105 main ] output: {"version":"eosio::abi/1.0","types":[],"structs":[],"actions":[],"tables":[],"ricardian_clauses":[],"error_messages":[],"abi_extensions":[]}