Overview

XGold is a virtual currency that circulates on the Expload Platform. It is similar in nature to Ethereum's ERC-20 token, however, its main purpose is to enable in-app purchasing in the games integrated with the Expload Platform. The user can buy XGold for fiat currency like Euro and spend in any game on the Expload Platform.

Given that the XGold program is a regular Pravda program, it can be compiled, deployed and called as any other Pravda program.

The program’s source code is available on Github: https://github.com/expload/XGold.

You can check out the documentation on how to compile and deploy programs here, the Compiling the Program section .

Terms

Term Description
Sender An account who signed the transaction that contains the calls of program methods.
Whitelisting The process of adding an address to the trusted list of the XGold program. The calling of certain methods is only permitted for the whitelisted addresses. Therefore, before any such methods are called, you should add all the respective addresses to the whitelist. However, please be aware that addresses can only be added/removed by the XGold program owner.

Public Methods

The methods below are public and can be called directly or from another program.

MyBalance

This method returns the XGold balance of the Sender's account.

Give

This method gives the recipient the respective amount of XGold.

Note: This method can only be executed by the XGold program owner.

Burn

This method withdraws the respective amount of XGold from the recipient's account.

Note: This method can only be executed by the XGold program owner.

Spend

This method transfers the respective amount of XGold from the Sender's address to the recipient’s address. The recipient’s address should be whitelisted by the XGold program.

Refund

This method transfers the respective amount of XGold from the Sender’s account to the recipient’s account. The Sender's account should be whitelisted by the XGold program.

WhitelistAdd

This method adds the given address to the whitelist of the XGold program.

Note: This method can only be executed by the XGold program owner.

WhitelistRemove

This method removes the given address from the whitelist of the XGold program.

Note: This method can only be executed by the XGold program owner.

Public Events

Certain events are generated by the corresponding public methods:

  • Spend
  • Give
  • Burn
  • Refund

All the events are only generated in the case of success, when the action is complete.

Check out the documentation on how to get the events here