When I try to compile the contract the process creates an infinite loop. Here is my code, please help!
kjnjrwsyxszg.cpp
#include "kjnjrwsyxszg.hpp"
void kjnjrwsyxszg::create(const name owner, const string name, const uint64_t attack)
{
// Instantiate items_table
items_table items(_self, _self.value);
// Create and set item
items.emplace(owner, [&](auto &item) {
item.id = items.available_primary_key();
item.name = name;
item.attack = attack;
item.owner = owner;
});
}
kjnjrwsyxszg.hpp
#include <eosio/eosio.hpp>
#include <string>
using namespace eosio;
using namespace std;
class[[eosio::contract("kjnjrwsyxszg")]] kjnjrwsyxszg : public eosio::contract
{
public:
using contract::contract;
[[eosio::action]] void create(const name owner, const string name, const uint64_t attack);
private:
// @abi table items i64
struct [[eosio::table]] Item
{
uint64_t id;
string name;
uint64_t attack;
eosio::name owner;
auto primary_key() const { return id; };
};
typedef multi_index<"items"_n, Item> items_table;
};