2

I am writing a smart contract and I am receiving this error message:

Error 3070002: Runtime error processing WASM Error details: Exceeded call depth maximum

I am confused, since I believe this error is relate to recursion, and I am not using recursion anywhere in my code.

Using print statements, I have found that the error is occuring when emplacing a new table row into a multi-index array:

    table.emplace(user, [&](auto & entry)
        {
        entry.setuser(user);
        entry.setvector(myvector); // Error occurs after this line
        });
               // But before this line
  • What is the definition of table? And what is the type of myvector? – John Haager Nov 13 '18 at 21:32
2

Reason 1

I guess you forgot to set the "table" to be included in the ABI file.

If you are using the old compiler eosiocpp, then add this before your definition of the table struct/class:

///@abi table table i64
struct table...

If you are using eosio.cdt to compile:

struct [[eosio::table]] table...

Reason 2

You forgot to include EOSLIB_SERIALIZE in the case where your struct or class uses non-default constructors

|improve this answer|||||
  • 1
    This solved the problem, thanks very much! – Michael Nash Nov 15 '18 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.