9
votes
Accepted
How to get current time in different versions of EOSIO
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::...
4
votes
Accepted
How do I pass an iterator?
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::...
2
votes
Why does the -abigen option in eosio.cdt not work?
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 ...
2
votes
What exactly the merkle function is returning?
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 ...
2
votes
Accepted
atomicassets mintasset in contract
The very kind and helpful includenull has answered my question on the wax discord but I'll post the answer here for anyone who had the same issues.
action(
permission_level(get_self(), "active&...
2
votes
Accepted
COMPILATION ERROR error: non-type template argument is not a constant expression
"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-...
1
vote
Accepted
COMPILATION ERROR error: static_assert failed "Something went wrong. Please report this issue to the github
Change std::make_tuple(itr) to std::make_tuple(*itr). The type of itr is const_iterator and it's not serializable.
1
vote
Can we store date on eosio table?
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, ...
1
vote
Accepted
Defining symbols for a contract at compile time - how?
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 ...
1
vote
Contract compilation fails during elemental battles tutorial
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 ...
1
vote
ABI file not generated
I wasn't getting an abi file, but it was compiling fine.
I finally noticed that I had the file named: widgets.cpp but the class was widget. Watch out for missing "S"s.
Ran again and the abi ...
1
vote
Accepted
Serialization Error Processing WASM while following hello.cpp tutorial
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 ...
1
vote
Accepted
Issue while compiling smart contract - eosio.cdt
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
vote
How to avoid "Warning, empty ricardian clause file" warnings?
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, ...
1
vote
eosio-cpp -abigen hello.cpp -o hello.wasm
solved and it was because of the virtual machine.
https://github.com/EOSIO/eosio.cdt/issues/123
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
eosio-cpp × 24eosio.cdt × 14
smart-contract × 13
eosio-code × 6
compilation × 6
eosio.token × 2
c++ × 2
abi × 2
abigen × 2
cleos × 1
table × 1
dapp × 1
development × 1
deferred-transactions × 1
eosio.system × 1
eosiocpp × 1
ricardian × 1
library × 1
http × 1
cmake × 1
code × 1