Calling Functions in a Wapp

Get Tokens

Help Us

Grow

Create a

Wapp

You can interact with an Wapp now (by the 'command line interface' of MyEtherWallet, before the Workchain OS is completed) to get various kinds of information about it such as its current price, total supply, and more. A Wapp is actually made up of two contracts: one for tokens, and the main Wapp contract.

1.

Go to MyEtherWallet (MEW) and log in to your wallet.

(Note: (If you're in a Fantom-based Wapp, make sure you're connected to the Fantom Opera network by referring to instruction #2 here.)

2.

Click on the 'Contract' drop-down, then 'Interact with Contract'.

3a.

In the 'Contract Address' field, enter the ​Wapp's contract address if you want to do any of the following:


  • Find out Wapp parameters
  • Find out the current rate
  • See how many previous transactions there have been
  • Perform the 'distribution snapshot' so rewards can be distributed

Note that the contract address is the address you used to get Wapp tokens, not the address you used to add the token as a custom token to MyEtherWallet.


(Refer to step 3b, below, to see other functions you can make from the ​Wapp'stoken address.)


In the 'ABI/JSON Interface' field, enter the ABI for the contract by copying and pasting the text that can be found here.

Note: do not click 'Select an Item' but click the Continue button

The resulting page is where we see our list of functions. Select the one you'd like to use.


Some of the more useful functions include:

durationOfMinTokenGetAmount

This is the duration of the function 'minTokenGetAmount' below, which determines the minimum number of the Wapp's tokens you can get at any one time. If this value is "50" then it means the minimum will apply to the first 50 transactions.

startRate

To convert the resulting number, go here and input it into the 'wei' field to see the response in the 'Ether' field.] This is the genesis price of the Wapp.

getRemunerationQueue

This will show how long the queue is for remunerations.

distributionSnapshot

At the end of each block, someone must call this function (by clicking 'Write'. Otherwise, no new validations are possible and no rewards will be distributed. This function can called by anyone. Set the gas limit to 500,000 for this transaction.

getLengthQueueTownTokenRequests

The number of transactions waiting in the queue to obtain the Wapp token (when there is no available supply).

distributionPeriodsNumber

This is the number of distribution periods each new PDC will have. If this value is "12" it means that any tokens added to the Wapp will be divided into 12 equal distributions (12 successive pay periods).

lastDistributionsDate

The result will be a Unix timestamp. To convert this number, go here. For example, "1577750400" is equal to 31 December 2019 00:00:00 (All contract times are in GMT).

maxTokenGetAmount

[To convert the resulting number, go here and input it into the 'wei' field to see the response in the 'Ether' field.] If the result is "50000" for example, it means that everyone is limited to getting 50,000 of the Wapp's token per transaction.

minTokenGetAmount

Same as above, but the minimum amount of tokens that can be had in any one transaction. Note the duration of this value (see the first function above, durationOfMinTokenGetAmount). 

minExternalTokensAmount

[To convert the resulting number, go here and input it into the 'wei' field to see the response in the 'Ether' field.] This value is the minimum number of tokens that can be added as a job at any one time. If the worker adds less, they will be kept in the contract awaiting additional tokens to reach the minimum.

sendExternalTokens

Refer to the section, 'Become a Worker'

getCurrentRate

To convert the resulting number, go here and input it into the 'wei' field to see the response in the 'Ether' field.] This value is the current rate of the Wapp token for the next transaction.

token

The Wapp's token address

transactionsCount

The number of transactions in the Wapp where the Wapp token was obtained.

3b.

In the 'Contract Address' field, enter the Wapp's token address if you want to do the following:


  • Find out basic Wapp settings regarding the token (name, total supply, decimals, symbol)

Note that the token address is the address you used to add the token as a custom token to MyEtherWallet.


In the 'ABI/JSON Interface' field, enter the ABI for the token by copying and pasting the text that can be found here. (Note that it is not the same code used in 3a, above.)

Note: do not click 'Select an Item' but click the Continue button

The resulting page is where we see our list of functions. Select the one you'd like to use.


The more useful functions include:

name

The name of the Wapp.

totalSupply

The total supply of tokens in the Wapp.

decimals

The number of decimals for the token.

getHoldersCount

The number of different addresses that hold the Wapp token.

owner

The address that began the Wapp. Note that this address has no special authority or rights once the Wapp has been initiated by linking the two contracts together, other than the ability to transfer ownership to the Ethereum genesis address. An 'owner' in the contract is a formality.

symbol

The ticker of the Wapp

Get Tokens

Help Us

Grow

Create a

Wapp

The software and information is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software. This software and information is for educational purposes only and is not intended to be used in any environment, production or otherwise..

Further, the information contained on this website is for informational purposes only and does not constitute an offer or solicitation to sell shares or securities in any entity or any related or associated company or entity. None of the information presented is intended to form the basis for any investment decision, and no specific recommendations are intended. Accordingly the information contained on this website does not constitute investment advice or counsel or solicitation for investment in any security.

This information does not constitute or form part of, and should not be construed as, any offer for sale or subscription of, or any invitation to offer to buy or subscribe for, any securities, nor should it or any part of it form the basis of, or be relied on in any connection with, any contract or commitment whatsoever. The operators of this website and its agents expressly disclaims any and all responsibility for any direct or consequential loss or damage of any kind whatsoever arising directly or indirectly from: (i) reliance on any information contained in the website, (ii) any error, omission or inaccuracy in any such information or (iii) any action resulting therefrom.