1

Im getting this error "eosio: assertion failure with message: datastream attempted to read past the end" when i try to call transfer function from another mine smart contract.

void simplenft::test(name receiver, const asset qty) {
      eosio::action(
          eosio::permission_level{get_self() , "active"_n },
          "MYCONTRACTNAME"_n, "transfer"_n,
          std::make_tuple( 
          get_self(), 
          receiver, 
          qty, 
          std::string("sent"))
      ).send();
}
3
  • 1
    I had this error in the case of trying to use eosio::unpack where the unpacker threw this as a result of not including the final byte of a std::string value. EOSIO adds a length prefix onto the string with LEB128 encoding. Credit to Todd t.me/c/1139062279/285824
    – Nat
    Sep 22 at 22:56
  • Have you found a solution to this yet?
    – sam
    Nov 21 at 21:05
  • Yes, string memo = ""; std::string sym = "PLA"; const asset quantity = asset{ 10000, symbol{"PLA", 4} }; eosio::action( eosio::permission_level{get_self() , "active"_n }, "MYCONTRACTNAME"_n, "transfer"_n, std::make_tuple( get_self(), receiver, quantity , memo ) ).send();
    – Plamen Pla
    Nov 22 at 22:04

Your Answer

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

Browse other questions tagged or ask your own question.