8

Until eosio.cdt v1.6 You could use: eosio::current_time() now() From eosio.cdt v1.6 onwards You have to #include <eosio/system.hpp> and then you can use: eosio::current_time_point eosio::current_block_time


3

I had the same question and ended up figuring it out by reading the multi_index.hpp from eosio.cdt code and wanted to share my solution. Instead of using auto, declare the type by using myindex::const_iterator: struct [[eosio::table]] _obj { name key; uint64_t primary_key() const { return key.value; } }; typedef eosio::multi_index<name("...


2

The solution to my problem was that the wasm file had to exactly match the name of the contract in the attributes of the contract class. So as my file was called mycontract.wasm, I had to have the following in my contract class: class [[eosio::contract("mycontract")]] token : public contract { // the name of the class must be mycontract ... }; After this, ...


2

You have multiple questions in this post, in the future you should try to have a more focused question. ".front()" is a vector function. From the documentation: std::vector::front() Returns a reference to the first element in the vector. Now, I'll assume you weren't actually asking about front(), and instead about the purpose of the merkle() function ...


2

"requestLoan" isn't a valid name for an EOSIO table; it only supports lower-case names using alpha characters. https://developers.eos.io/eosio-cpp/docs/naming-conventions#section-table-names-structs-functions-classes


1

Change std::make_tuple(itr) to std::make_tuple(*itr). The type of itr is const_iterator and it's not serializable.


1

Yes. You can either convert the data to a uint64_t as you have showed above, or you can use the time_point types: time_point time_point_sec block_timestamp_type I believe of the above, time_point_sec is likely most common. time_point_sec is a lower resolution timestamp accurate to seconds. time_point_sec format: yyyy-MM-dd T HH:mm:ssz time_point format:...


1

I'd start by removing the quotes from "__CONTRACT__". Anything in quotes is a string literal, and should not get replaced. If you need the quotes right there, try specifying the quoted string on the right side of the definition, like #define __CONTRACT__ "t".


1

Okay, I have find the solution, it was a classic header include problems, so you just have to add -I. at the end like eosio-cpp -o cardgame.wasm cardgame.cpp -abigen -I. more information about the issue here: https://github.com/EOSIO/eosio.cdt/issues/489


1

The problem you are describing definitely appears to be related to your VM only having one core. Please double check that your VM has 2 or more cores allocated to it, and that you have restarted your VM after making the necessary adjustment. Additionally, eosio.cdt 1.6.0 has some issues that may cause problems, please upgrade to eosio.cdt 1.6.1 immediately.


1

I have solved the issue by using below commands sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install gcc-4.9 sudo apt-get install --only-upgrade libstdc++6


1

Probably not. It looks like what you said should work, but if it's not, I don't see another flag that would do that. -w | - Suppress all warnings They (the warnings) were there at the beginning, then they went away, and now it looks like they're back. This is a good thing because it will remind developers to add them. Technically, the current ...


1

solved and it was because of the virtual machine. https://github.com/EOSIO/eosio.cdt/issues/123


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