eos icon indicating copy to clipboard operation
eos copied to clipboard

can not get table abi

Open yekai1003 opened this issue 8 years ago • 5 comments

eosiocpp -g mytoken.abi mytoken.cpp

false: Unable to guess index type
    {}
    thread-0  abi_generator.cpp:348 guess_index_type

    {"type_name":"account"}
    thread-0  abi_generator.cpp:273 handle_decl

    {}

yekai1003 avatar May 07 '18 06:05 yekai1003

You should use the command like this: $ eosiocpp -g ${contract}.abi ${contract}.hpp

--> eosiocpp -g mytoken.abi mytoken.hpp

refer link: https://github.com/EOSIO/eos/wiki/Smart-Contract#abi

quocle108 avatar May 08 '18 16:05 quocle108

I add a field named "id" to my struct, and my problem is fixed

Phoenix117 avatar May 09 '18 09:05 Phoenix117

 // @abi table
        struct acct {
            uint64_t id;
            asset balance;
            uint64_t frozen = 0;
            uint64_t whitelist = 1;
            
            uint64_t primary_key() const { 
                return id;
            }
        };

My problem has been solved in this way

yekai1003 avatar May 09 '18 09:05 yekai1003

Please make sure your primary_key member is of type uint64_t and is the first member in the struct.

taokayan avatar Jun 20 '18 03:06 taokayan

i meet the same problem

zsq978663747 avatar Aug 22 '18 03:08 zsq978663747