OrderSystem

Git Source

Inherits: System

Functions

createOrder

Create an order

Free for admin, charges reward cost (_reward * _maxPlayers) for non-admin

function createOrder(MaterialId _materialId, uint256 _amount, uint256 _reward, uint32 _duration, uint32 _maxPlayers)
    public
    returns (bytes32 orderEntity);

Parameters

NameTypeDescription
_materialIdMaterialIdMaterial id to produce
_amountuint256Amount to produce in whole units
_rewarduint256Reward for completing the order in whole units
_durationuint32Duration of the order. 0 means no expiration
_maxPlayersuint32Maximum number of players that can accept the order

Returns

NameTypeDescription
orderEntitybytes32Id of the offer entity

cancelOrder

Cancel an order

Restricted to admin

function cancelOrder(bytes32 _orderEntity) public;

Parameters

NameTypeDescription
_orderEntitybytes32Id of the order entity

acceptOrder

Accept an order

This simply indicates that a user is committed to an order

function acceptOrder(bytes32 _orderEntity) public;

Parameters

NameTypeDescription
_orderEntitybytes32Id of the order entity

unacceptOrder

Unaccept the current order

function unacceptOrder() public;