Questions tagged [c++]
All questions related to the use of C++ within the EOSIO framework
13
questions with no upvoted or accepted answers
2
votes
0
answers
241
views
What are the main differences betwen EOSIO multi_index and Boost multi_index?
Inspired by this comment, I was wondering what are the main differences between eosio::multi_index and boost:multi_index and why do they exist?
The documentation notes that there are important ...
1
vote
0
answers
34
views
Build existing autoconf C project to include in smart contract
I'd like to include GNU's GMP library in my smart contract project.
It's an autotools/autoconf project, how can I compile it as a standalone webassembly library and then include it in my smart ...
1
vote
1
answer
49
views
Profiling EOS.IO smart contract code
What's the best way for profiling the code of an EOS.IO smart contract?
I'd like to know what percentage of the CPU time is spent on executing each function\line (including multi index table function ...
1
vote
1
answer
454
views
Transfer tokens inside a smart contract from an account to another account
I need to write a simple function that would send tokens using a different account action. Exactly the same situation as in these questions: one and two
But I have to use not eosio.token contract but ...
1
vote
1
answer
614
views
How to solve !action_type.empty(): Unknown action hi in contract hello?
I am following this doc: https://developers.eos.io/eosio-home/docs/your-first-contract.
This is the hello.cpp contract code which is successfully deployed:
#include <eosiolib/eosio.hpp>
#...
1
vote
0
answers
102
views
How to solve !action_type.empty(): Unknown action hi in contract hello?
I am following this doc: https://developers.eos.io/eosio-home/docs/your-first-contract.
This is the hello.cpp contract code which is successfully deployed:
#include <eosiolib/eosio.hpp>
#...
1
vote
1
answer
152
views
Smart contract error while calling recover_key
Specs
I am using the function recover_key from the library crypto.h at the following link: https://github.com/EOSIO/eos/blob/master/contracts/eosiolib/crypto.h
Code
int compressed_size = ...
0
votes
1
answer
12
views
Alternative to std::ifstream for eosio contract
I'm watching for an alternative to "std::ifstream" because "#include " can't include as header in a contract.
My code is:
std::istream& operator>>(std::istream& str, ...
0
votes
1
answer
53
views
Nested depth exceeded
kipping set abi because the new abi is the same as the existing abi
Publishing contract...
Error 3070002: Runtime Error Processing WASM
Error Details:
Nested depth exceeded
pending console output:
...
0
votes
1
answer
56
views
Runtime error (eos-vm system failure) on using C++ `virtual` keyword?
In my contract I have a data structure that involves a node struct and a LeafNode and InnerNode struct that inherit from node.
struct node {
...
virtual string to_string() const {
...
0
votes
0
answers
47
views
Catch errors when calling deposit
When I send EOS in a contract to several recipients, it can happen that this fails, e.g. because a recipient has a contract running like that:
Example contract of one recipient:
[[eosio::on_notify("...
0
votes
1
answer
143
views
multi_index table get const_iterator at a specific position
is there a better way than a loop to get the value/const_iterator at a specific position in multi_index table?
current:
auto idx = _table.get_index<"name"_n>();
const_iterator b;
int count = ...
0
votes
1
answer
232
views
How can I create a table in an .hpp for a general contract? (Using the CDT)
THE STRUCTURE OF MY PROJECT
I am working in mycontract.cpp, which imports myheader.hpp
WHAT I WANT
I want to create a table in myheader.hpp, for a generic contract, "IN THEORY" as follows:
struct [...