Create Your Own Micro-economy for Workchain OS

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

Creating an ITO takes about 15-30 minutes. Note that once you create it, you won't have any authority or special rights over it. Instructions below.

1.

Copy the Workchain code here from line 1 all the way down, then paste it into a text editor.

2.

Search for 'TTW' in the text and change the following parameters to your own

string public constant name = "Town Token";

string public constant symbol = "TTW";

uint8 public constant decimals = 18;

3.

Save the file as flattened.sol (or something with an .sol extension, like BOZO.sol) and open up remix.ethereum.org in a browser

4.

On this page, perform the following steps:


  1. Under Environments click on the Solidity box,
  2. Under File click 'Open File' and select the .sol file you just saved.
  3. Scroll down to 0.5.0. and select it
  4. Click the 'Enable optimization' box
  5. Click the 'Compile' button
5.

Give it a few seconds to compile. When it is finished, you'll see the 'Contract' box


  • In the Contract box, select 'Town' (third from bottom. It will have your file name)
  • Click on 'ABI' at the bottom. This will automatically copy it to your clipboard. Open up a text editor as save the file as contract_ABI.txt
  • Do the same for 'Bytecode', saving it as contract_Bytecode.txt
  • Next, click the box (1) again and select 'Town Token' and click the ABI button, then paste it into a file you save as token_ABI.txt
  • Then, click the Byecode button, then paste it into a file you save as token_Bytecode.txt
6.

Log in to your MyEtherWallet account 

Creating a Fantom-based ITO? Click here

7.

First, we need to deploy the ITO token by going to the menu's 'Deploy Contract' selection under 'Contract'


  • In the 'Byte Code' box, please in the text from your token_Bytecode.txt file
  • In the 'ABI/JSON Interface' box, please in the text from your token_ABI.txt file
  • In the 'Contract Name' field, put in the name of your ITO.
  • Click 'Sign Transaction' and confirm.
  • We will see a notification from the bell icon on the top right that will display the status of our new contract creation transaction. Click this to view the 'Created Contract Address' and copy it. (You may have to type it manually into a text editor.)
  • Keep your token address -- you'll need it later.


8.

Next we create our main contract for the token. Clicking on 'Deploy Contract' again:


  • In the 'Byte Code' box, please in the text from your contract_Bytecode.txt file
  • In the 'ABI/JSON Interface' box, please in the text from your contract_ABI.txt file
  • You will then see a new 'Constructor Inputs' section open up. Here is where we will input most of the settings for the ITO.
  • These fields are as follows.

distributionPeriod

How many days is a work block? For 7 days, enter "7" (without quotes)

distributionPeriodsNumber

How many distribution periods will there be for newly-added tokens? For 5 periods, enter "5"

startRate

What is the ITO's genesis value? This value is measured in wei. [See here for a converter. If you wanted a starting rate of 0.002 ETH then enter '0.002' in the 'Ether' box and copy the value displayed in the 'wei' box and paste it into the startRate field.] 

minTokenBuyAmount

What is the minimum amount that a single address could obtain in each of the first few transactions? Enter the value + 18 zeros (or go here for the converter by entering the value in 'Ether' and copying from 'wei')

durationOfMinTokenBuyAmount

For how many transactions do you want this minimum requirement to last? For the minimum to apply to the first 50 transactions, enter "50"

maxTokenBuyAmount

What is the maximum number of tokens that someone could obtain in a single transaction? Enter the value + 18 zeros (or go here for the converter by entering the value in 'Ether' and copying from 'wei')

minExternalTokensAmount

What is the minimum number of external token that a producer could add to the ITO? Enter the value + 18 zeros (or go here for the converter by entering the value in 'Ether' and copying from 'wei')

address tokenAddress

Paste your token address into this field (from step 7)

  • Finally, enter the name of your ITO
  • You should save your inputs here into a text file, as you will need them to verify the contract on Etherscan in step 14 below.

Your inputs will look similar to the following:


  • Then click, 'Sign Transaction' and confirm.


9.

Once the transaction is complete, copy your new main contract address (and save it!)


10.

We now need to initialize the ITO by linking the two contracts together, and inputting the number of ITO tokens to issue.


  • In the 'Contract' menu, select 'Interact with Contract'
  • In the 'Contract address' field, enter your token address.
  • Copy the text from your token_ABI.txt file and paste it into the 'ABI/JSON Interface' box
  • Click the 'Continue' button


12.

On the 'Read/Write Contract' box, click the drop-down and scroll to 'init' (4th from the bottom). When you click this, new fields will appear.


  • In the 'TotalSupply' box, enter how many tokens your ITO will have in its supply (in wei; to convert see here)
  • In the TownContract box enter the address of your main contract
  • (Just ignore the 'Value in ETH:' field)
  • Click 'Write' and confirm the transaction
  • Your ITO is now ready to go. You can confirm that by scrolling up to the 'initiated' function and checking if the result is 'true'
  • ITO token buyers would send ETH to the contract address
  • To add the ITO as a custom token in your MyEtherWallet menu, use the token address.
  • To 
13.

Change the owner of the contract to Ethereum's genesis address by clicking 'renounceOwnership' (while still in the 'interact with contract' box for your token address).


This function makes no difference, as the owner has no authority. It just looks better in Etherscan if there is an invalid address listed as the owner.

14.

You'll probably also want to verify your contract code so that people can read it from Etherscan and see what's inside. 

  • Go to the verify contract page on Etherscan and put in your contract address into the first field
  • In the next field, select 'Solidity - Single File'
  • Select '0.5.0' for compiler version
  • Then select MIT license (#3), agree to terms, then continue
  • In the 'Enter the Solidity Contract Code' box, enter your code from step 3 (above)
  • In the 'Optimization' box, select 'Yes'
  • In the 'Constructor Inputs' box, we'll need  to go here and scroll down to where it says 'Or enter your parameters manually'
  • Here, we will enter our inputs from step 8 (above).
  • We are adding 8 inputs. The first 7 are 'uint (256)' type. The last input is 'address' type.
  • The code in the 'ABI-encoded output' box will change on the fly. When you're done entering all the inputs, click 'Copy'
  • Paste it into the 'Constructor Arguments' box on Etherscan, then click 'Verify and Publish'
  • It should confirm automatically with a green icon next to your contract, with the ability for the public to read it.
  • You can do the same for the token contract, but without putting anything in the 'Constructor Arguments' box. (But be sure to select 'Yes' for the Optimization drop-down.)

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.