Questions tagged [c++]

All questions related to the use of C++ within the EOSIO framework

13 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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 ...
confused00's user avatar
  • 5,554
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 ...
Guillermo Rodriguez's user avatar
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 ...
Yogev Mashiach's user avatar
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 ...
Dim's user avatar
  • 21
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> #...
Riccardo Persiani's user avatar
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> #...
Riccardo Persiani's user avatar
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 = ...
Riccardo Persiani's user avatar
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, ...
Eosio's user avatar
  • 1
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: ...
James Cai's user avatar
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 { ...
Taner Seytgaziyev's user avatar
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("...
elpol's user avatar
  • 1
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 = ...
sinbad's user avatar
  • 99
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 [...
Riccardo Persiani's user avatar