Calling Functions in a Wapp

Note: The following information is provided for educational purposes only and does not authorize, permit, endorse, or in any way approve of its use. By accessing or using the site, you agree to be bound by the terms and conditions set forth below. If you do not wish to be bound by these terms and conditions, do not access or use the site.

Join

Produce

Create

You can interact with an ITO's contract to get various kinds of information about it such as its current price, total supply, and more. An ITO is actually made up of two contracts: one for tokens, and the main ITO contract.

1.

Go to MyEtherWallet (MEW) and log in to your wallet. (If you're in a Fantom-based ITO, 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 ITO's contract address if you want to do any of the following:


  • Find out ITO contract 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 the ITO 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 ITO's token 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 ITOs 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 value of the ITO.

getRemunerationQueue

This will show how long the queue is for refunds.

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 ITO token (when there is no available supply).

distributionPeriodsNumber

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

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 ITO'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 producer adds less, they will be kept in the contract awaiting additional tokens to reach the minimum.

sendExternalTokens

Refer to the section, 'Producing for an ITO'

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 ITO token for the next transaction.

token

The ITO's token address

transactionsCount

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

3b.

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


  • Find out basic ITO 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 ITO.

totalSupply

The total supply of tokens in the ITO.

decimals

The number of decimals for the token.

getHoldersCount

The number of different addresses that hold the ITO token.

owner

The address that began the ITO. Note that this address has no special authority or rights once the ITO has been initiated by linking the two contracts together. An 'owner' in the contract is a formality.

symbol

The ticker of the ITO

Join

Produce

Create

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.