I am writing a smart contract that uses a multi index table with a member type double.

//@abi table tbltest i64
struct test{
    uint64_t uid;
    double margin;

    uuid_t primary_key() const { return uid; }


When I try to generate an abi file using eosiocpp tool I get the following error

root@eos# eosiocpp -g test.abi test.cpp
3583446ms 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)
thread-0  abi_generator.cpp:606 add_type
thread-0  abi_generator.cpp:290 handle_decl

If I change the type to uint64_t it works. But It generates an error if I use float or double. Why abi-generator does not support these types?

  • Maybe you should add the definition of your multi_index table, that we can analyze the cause of the error... Did you try to use the double as primary key? Documentation says only uint64_t is allowed to be the primary key...
    – tmm
    Jun 2, 2018 at 12:19

1 Answer 1


This issue in eosiocpp tool is resolved in the release version 1.0.2 as I am not getting this error now. I got this error previously in Dawn 4.0.0

  • Can you tell me how you update your version to 1.0.2, Am also getting the same error while compiling my abi file. Aug 31, 2018 at 5:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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