Skip to content

Instantly share code, notes, and snippets.

@johnX9
Last active June 14, 2018 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnX9/af2cf7fd5bf42de8b8e654371e221102 to your computer and use it in GitHub Desktop.
Save johnX9/af2cf7fd5bf42de8b8e654371e221102 to your computer and use it in GitHub Desktop.
//@abi action
void buy(account_name buyer, uint64_t productId);
//@abi action
void getbyid(uint64_t productId);
/**
* Marketplace processes
*/
//@abi table product i64
struct product {
uint64_t product_id;
string name;
uint64_t power;
uint64_t health;
string ability;
uint64_t level_up;
uint64_t quantity;
uint64_t price;
uint64_t primary_key() const { return product_id; }
EOSLIB_SERIALIZE(product, (product_id)(name)(power)(health)(ability)(level_up)(quantity)(price))
};
typedef multi_index<N(product), product> productIndex;
//@abi action
void add(account_name account, product newProduct);
//@abi action
void update(account_name account, uint64_t product_id, uint64_t quantity);
//@abi action
void remove(account_name account, uint64_t productId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment