TokenGen Showcase: Smart Contract Generator for the Token Economy

The first main component of the Fabric Token ecosystem, TokenGen, is finally ready for its big reveal. This article will showcase the tool’s 1.0 version functionality and give you an in-depth guide on how to use TokenGen. So without further ado, we present to you, TokenGen.

The Setup

Before we get to the tool itself, we need to talk about what you need in order to use TokenGen. Since the tool is a decentralized application, you will need a web3-enabled browser in order to use it. We have integrated TokenGen with MetaMask (official website and guide), which provides an easy way for anyone to pay for their smart contract, log in and review their project history. Here’s what you will need in order to use TokenGen:

  • Chrome or any other web3-enabled browser such as Brave.
  • The MetaMask extension installed on the browser you chose.
  • A vault in your MetaMask and an account with some Fabric Tokens in it – TokenGen smart contracts can only be purchased with FT.

TokenGen Showcase

TokenGen will be accessible right after the FT ICO ends at tokengen.io. Some might wonder, since it’s almost ready anyway, why not right now? The reason for that is that the tool works in an all-or-nothing manner i.e. if you don’t pay for your smart contract, there isn’t much to play around with aside from clicking buttons and filling out inputs.

In order for us to open TokenGen for production use, we need the Fabric Token ICO to end, connect the tool with the main Ethereum network (as you will see in a minute, we are currently testing using the Ropsten testnet), and then we’re all set. That being said, let me show you what we’ve done so far with TokenGen.

The Homepage

When you open TokenGen for the first time, you will land on the following page:

TokenGen Homepage

As you can see, it is a very simple homepage that gets right to the point. Currently, the video is just a placeholder as the real one is still in development. The background is actually animated and the expert consensus so far is that looks pretty cool, but you guys will see that for yourselves once we open TokenGen to the public.

The next obvious thing to do for anyone landing on the TokenGen homepage is to, well, try the tool. Clicking the Try TokenGen button will redirect you to the Create Token page, though, you need to be logged in to your MetaMask and into TokenGen itself in order to access it. Here’s how that’s done:

Logging Into TokenGen via MetaMask

First of all, if you don’t have MetaMask installed in your browser, you will see the following error message:

TokenGen Login Web3 Disabled

If you have MetaMask installed, but you haven’t yet created a vault and logged into it, you will see the same screen, but with an error message urging you to login to your MetaMask vault. Once you do that, you will be allowed to login:

TokenGen Login Page

As you can see, we are logged into MetaMask on the Ropsten test network. When TokenGen is released, you will need to make sure you login to the main Ethereum network in order to use the tool. Now, once you are logged into your MetaMask vault, you can also login to TokenGen. Simply click the Login button.

You won’t need to fill out in any usernames, passwords, or emails – all you will have to do is sign a message with the account you have selected in MetaMask so we can verify the Ethereum address:

TokenGen Login Sign Message

Once you click the Sign button on the MetaMask window, you will be logged into TokenGen and redirected to your Profile page.

TokenGen Profile Page

The Profile page will be your dashboard, where you will be able to track your projects’ progress and download the smart contracts once they’re ready:

TokenGen Profie Page

As you can see, you can track details about your past projects as well as edit and download specific ones. For this showcase article, I have added a few of the more popular ERC-20 tokens, just to show you guys what the Profile page would look like for an active user.

Now, there’s a few columns that need clarification:

  • Description – this field shows what smart contract templates you chose when creating that specific token. We will talk more about the smart contract templates supported by TokenGen when we get to the Create Token process in a minute.
  • Status – TokenGen keeps track of the progress of your projects by displaying one of six statuses:
    • Smart contracts configured means that you have selected smart contract templates and provided info about your token, but you haven’t yet paid for the project.
    • Processing transaction means that you have successfully paid for your smart contracts, but you need to wait for the Ethereum network to confirm that transaction. On the back-end, we consider a transaction confirmed once 12 blocks have been found since you sent the transaction. That is approximately 3 minutes.
    • Transaction confirmed means that your transaction has been confirmed and TokenGen will now begin creating and testing your smart contracts.
    • Generating smart contracts means that TokenGen is bundling together the smart contract templates you have selected and inserting the smart contract info you provided i.e. token name, symbol, etc.
    • Running tests means that the smart contracts for the specific token have been created and are currently being tested to ensure security.
    • Done means that the smart contract is ready for download.
  • Progress – every status is assigned a certain percentage in terms of progress. These will update automatically in the background as we periodically check the current status of each of your projects with the server, .
  • Action – currently, TokenGen provides two actions on projects:
    • Edit – rebuilds the entire project and allows you to edit details such as token name, crowdsale start date, etc.
    • Download – allows you to download a ZIP with all of the smart contracts required to create your token and crowdsale.

And that’s pretty much it for the TokenGen Profile page. Again, it is simply the dashboard for your projects. Now, let’s create a new project and see how it is added to the dashboard and let’s see what TokenGen generates in the end.

How to Create a Token & Crowdsale Using TokenGen

First of all, you need to go to the Create Token page:

TokenGen Create Token Page

As promised, using TokenGen is a very simple and straightforward step-by-step process that allows you to create new tokens and crowdsales. We will briefly explain each of the smart contract templates provided by TokenGen 1.0. Detailed documentation will be available on the Documentation page. Now let’s go through the token creation process:

Step 1. Selecting Token Smart Contract Templates

In the first step, TokenGen users will need to select their token’s functionality. By default, the following will be included:

  • ERC-20 interface – the standard ERC-20 interface.
  • Implementation of the ERC-20 interface i.e. a standard token.
  • Ownable trait –  allows the owner of the smart contract to perform exclusive actions on the token.
  • Safe math library – provides methods for safe addition, subtraction, division, and multiplication.

This means that, if you don’t select any of the three smart contract templates shown in the image below, you will get a very basic ERC-20 token. If you hover over each of the smart contract templates you will see a short summary of what each template provides:

TokenGen Smart Contract Template Hover

Again, an in-depth explanation of what each smart contract template adds will be available on the Documentation page, but in short, here’s what the three additional token smart contract templates provide:

  • Burnable token – allows you to destroy tokens by sending them to the 0x0 address.
  • Mintable token – allows you to control the supply of your tokens by providing you with methods of creating (minting) tokens.
  • Pausable token – allows the owner to pause/unpause transfers on the token.

To continue our showcase, I will select all three smart contract templates for this example token that we are creating:

TokenGen Smart Contract Templates Selected

Users can easily select/deselect smart contract templates by clicking on their respective boxes.
Now that we are done with our token functionality, we can move onto the next step.

Step 2. Selecting Crowdsale Functionality

Step two of the TokenGen smart contract generation process is very similar to the step one, the only difference being that it applies to the the token’s crowdsale functionality:

TokenGen Create Token Step 2 Select Crowdsale Smart Contract Templates

For your token’s fundraiser, we have prepared three smart contract templates that cover the most popular crowdsale needs:

  • Capped fundraiser – sets a hard cap on your crowdsale.
  • Finalizable fundraiser – allows the owner to finalize the crowdsale once certain conditions are met i.e. a hard cap is reached.
  • Refundable fundraiser – adds a soft cap to the crowdsale and a refund functionality.

Again, if you hover over each of these smart contract templates you will see a brief explanation of what it does, with more details available on the Documentation page. By default, each user will get the basic functionality needed to run a crowdsale for their token. Going back to our example token, I will again select all smart contract templates so we can move on to step three.

Step 3. Providing Token & Crowdsale Details

In step three, users will have to provide some necessary details about their token and crowdsale:

TokenGen Step 3 Token and Crowdsale Info

Though the inputs are pretty much self-explanatory, here’s a brief overview of each one:

  • Token details:
    • Name – your token’s name.
    • Symbol – your token’s abbreviation (e.g. FT, ETH and so on).
    • Conversion rate – the number of tokens that will be sold per 1 ETH.
  • Crowdsale details:
    • Start date – the start date of your crowdsale.
    • End date – the end date of your crowdsale.
    • Beneficiary – the address where gathered funds by the crowdsale will be sent once the fundraiser is finalized.

An important thing to note here is that, if you are not sure about start date or end date, for instance, you can skip them and add them later – remember, you can edit your projects from your Profile page. Once a project has been edited, TokenGen will automatically rebuild your smart contracts and test everything anew.

For our example, I filled in the following token and crowdsale details:

TokenGen Step 3 Details provided

Once we’re done with that, we can move on to the final step – review and payment.

Step 4. Review & Payment

As mentioned, TokenGen will only accept payment in Fabric Tokens. So, since the FT ICO has yet to come, and since we still needed to implement and test the payment process, we have done the following setup in order to achieve that:

  • We have created a simple ERC-20 token using Token Factory and deployed it on the Ropsten testnet – https://tokenfactory.surge.sh/#/token/0xf8227435f68ab55234dd5fc61e8ebe7081dd9db7.
  • The token has a total supply of 100,000,000 (100 million) with 18 decimals and we appropriately named it Fabric Token (FT).
  • We have created a MetaMask vault on the Ropsten testnet and created two addresses:
    • Owner – 0x5Ea87dd5f7952b4040C884f3DBb08d400Fef30Fd
    • Beneficiary – 0x7B2e4419D852CC1c0beA3A2e9891830394a360c3

So the way this works is, a user pays in Fabric Tokens for their smart contract and the sum paid in FT goes to the beneficiary address, which is basically TokenGen’s wallet. In our example, we will use the Owner address to pay for the Example Token we created above. So, if we go to Token Factory and check how much FT the Owner address has, we would see that it has 99,999,900, because we already tested the process and sent 100 FT to Beneficiary:

TokenGen User Account

And if we check Beneficiary address’s balance, it should have exactly 100 FT:

TokenGen Beneficiary Address Balance

So far, so good. Now, let’s use the Owner account to pay for our Example Token smart contracts and see if everything goes right. Before doing that, however, we can review the project to make sure that we have selected the right templates and filled in the correct details for our token and crowdsale:

TokenGen Review & Payment

Once we make sure that everything is good to go, we can go ahead and purchase our smart contracts. The standard fee for TokenGen will be 100 Fabric Tokens, or roughly $11.25 by the FT ICO price regardless of how many smart contract templates the user has selected. As explained in the White Paper, we wanted to make this tool as cost-effective as possible, so that we can help blockchain-based startups to focus more on the value of their project.

We do plan on adding more advanced smart contract templates, which will have an individual price (again in Fabric Tokens) in addition to the standard 100 FT fee, however, that will happen in TokenGen 2.0 once it is released in April.

Anyway, all that’s left to do now is simply click the Purchase Smart Contracts button:

TokenGen Confirm Payment Transaction

Immediately, MetaMask will fire up and open a confirmation window. Once the user confirms the transaction and the transaction hash is returned by the Ethereum network, they will see the following message:

TokenGen Transaction Successful

Keep in mind that it takes something like 10 – 60 seconds for the transaction hash to be returned so users must not refresh the page as long as the button says “Processing Payment”. Now let’s see if the payment actually went through by checking the account balance of both the Owner and the Beneficiary on Token Factory.

Beneficiary:

TokenGen Beneficiary Balance After Payment

Owner:

TokenGen Owner Balance After Payment

Everything seems to be in place. We can now check our project’s progress on our profile page:

TokenGen Profile Page Track Status

As you can see, the transaction for our Example Token is already confirmed so TokenGen will soon start generating and testing the smart contracts. As mentioned, we wait for 12 block confirmations before we consider a transaction confirmed so it usually takes about 3 minutes – new blocks on the Ethereum blockchain are added every 15 seconds or so.

Now, let’s move onto the final step of the TokenGen process – downloading your smart contracts.

Downloading TokenGen Smart Contracts

After the payment transaction is confirmed and your project is built and tested, TokenGen will automatically change its status to “Done”. Once that happens, the progress bar will fill up to 100% and the Download button will appear for that project:

TokenGen Download Smart Contracts

Once you click Download you will download the end result of the TokenGen process – a ZIP archive with all of the smart contract templates that you have selected plus the standard ERC-20 token functionality and crowdsale methods:

TokenGen Example Token ZIP

If we go ahead and open the “Fundraiser.sol” file, we will see that the details we provided in step three are correctly filled in:

TokenGen Example Token Details Injected

And that’s pretty much it for this TokenGen showcase. The rest of this article will cover our plans for TokenGen in February.

What’s Next for TokenGen

As we mentioned in the beginning, we need the Fabric Token launch to end before we can release TokenGen to the public. Right now, there are a little over 10 days left until the FT ICO starts and we have already prepared a to-do list for TokenGen so we can open it for work as soon as possible after the Fabric Token ICO ends:

  • We need to perfect and polish the smart contract templates for TokenGen 1.0.
  • We need to implement the testing of the finished smart contract templates and add it as a background automatic process i.e. status “Running tests…”.
  • We need to improve a few labels and texts around the website and tweak the design wherever necessary.
  • We need to write the Documentation page once we’re ready with the final code for the smart contract templates.
  • And finally, once the FT ICO is over, we need to integrate TokenGen with the main Ethereum network and the real Fabric Token smart contract so people can begin creating token and crowdsale projects.

A quick note – the smart contract templates we have at the moment are fully operational however, we do want to change the structure a bit to make the code more efficient. Once all of this is done, TokenGen 1.0 will be 100% ready for production use.

From what we have seen so far, the interest in the Fabric Token ICO is huge considering the low cap of $9 million USD that we have set. So it is not a long shot at all to say that the hard cap might be reached within the very first few minutes after we open. If that happens, we will make sure that TokenGen is up and running before the end of February, as promised in the White Paper.

TokenGen 1.0 will provide standard token and crowdsale functionality, but we aim to extend that scope quite a lot with TokenGen 2.0 by providing more advanced smart contract templates such as token safe and bounty program, to name a few. With TokenGen 1.0, we wanted to lay the foundation for the tool in a way that would make it easy for us to scale the functionality scope it covers. And that’s exactly what we have done.

Final Notes

With the Fabric Token ICO right around the corner, we believe we have hit the right moment to showcase TokenGen. This will further show people that this is a serious project and that we are more focused on the product rather anything else.

As you saw, we have created TokenGen specifically for the token economy and we really think that the tool can become the go-to product for token and crowdsale smart contract generation. Especially non-technical individuals should really appreciate the simple and intuitive user interface of TokenGen.

And this is only the beginning. Wait until you see DApp Workbench, the main component of the FT ecosystem, and the benefits it will provide to businesses interested in blockchain. That is when we expect this project to really take off. Until next time.

Leave a Reply