Hot answers tagged

2

Yes, your approach is good. Only issue is efficiency. Your tokens will be processed using more CPU than the regular eosio.token contract tokens due to the extra steps to match by the secondary key. Good luck, and don't forget to share a link to the implementation.


1

As the compiler indicates .../include/eosiolib/print.hpp:237:9: error: no member named 'print' in 'std::__1::basic_string' t.print(); ... after check the the source code of print.hpp inline void print( const std::string& s) { prints_l( s.c_str(), s.size() ); } inline void print( std::string&& s) { prints_l( s.c_str(), s.size() ); } ... ...


1

eosio::name is uint64_t internally and encodes string with BASE32. If you are sure that your tableid will contain chars in range of [.1-5a-z] and its length won't exceed 12 (or 13th-char only can have [.1-5a-j]), you can use it as primary key. By the way, the size of string is determined by its length, so if your tableid are expected to be longer than 8 in ...


1

I have tried your code and i also have coded in updated version of eosio compiler i.e, eosio.cdt my code to modify table data is look like this void tablecheck::updatedata ( capi_name user , string name ) { require_auth( _self );// requires authorization of contract owner checktb ctbl(_self, user); auto it = ctbl.find(user); // adding ...


1

As of eosio.cdt v1.5.0, you can not make a secondary index from a string. The types of secondary indices allowed are: uint64_t secondary_1; uint128_t secondary_2; checksum256 secondary_3; double secondary_4; long double secondary_5; In principle, you could encode your string as a eosio::name and store it in a uint64_t, but ...


1

When describing a vector in your ABI file, simply append the type with [] in pt 2.3 of documentation https://developers.eos.io/eosio-home/docs


Only top voted, non community-wiki answers of a minimum length are eligible