An inventory smart contract for the EOS Blockchain
EOS Smart Contract for creating a blockchain based inventory.
Let’s say you have a video game that wants to use EOS for managing a user’s inventory. Here’s a general way of how this could potentially be used.
(Anything in ‘camelCasing’ is a variable)
ie. accountName = YOUR ACCOUNT NAME
cleos get table accountName accountName accounts
cleos get table accountName accountName queue
Action:
Properties:
cleos push action accountName issueitem '["accountName", 12345, "Fish", "Food", "Issued Item"]' -p accountName
Action:
Properties:
cleos push action accountName useitem '["targetAccount", 12345, "Used Item"]' -p targetAccount
Action:
Properties:
cleos push action accountName popqueue '["targetAccount", 12345, "Removed from Queue"]' -p accountName
Action:
Properties:
Options:
cleos push action accountName clear '["accounts", "Cleared the table."]' -p accountName