Last active
June 14, 2018 21:00
-
-
Save johnX9/af2cf7fd5bf42de8b8e654371e221102 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@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