Tokamak Network TON Swap System Overview

Joe
Joe
Aug 19 · 10 min read

0. Overview

Image for post
Image for post

The TON(Tokamak Network Token) circulation and distribution model has recently been announced. More than just giving the word of the Tokamak Network team, in order to enforce the circulation and distribution model, we have built a Token Swap Smart Contract. In this post we will give an overview of the structure and functions of the smart contract. This is to provide clarity for token holders and resolve any relevant concerns

1. Tokamak Network Swap System

Image for post
Image for post

The TON(Tokamak Network Token) circulation and distribution model has recently been announced. More than just giving the word of the Tokamak Network team, in order to enforce the circulation and distribution model, we have built a Token Swap Smart Contract. In this post we will give an overview of the structure and functions of the smart contract. This is to provide clarity for token holders and resolve any relevant concerns

2. Why do we Need a Token Swap System?

A smart contract is a programmable contract. With traditional legal contracts, in the event that it isn’t followed, the legal system intervenes to enforce the contract. With smart contracts, the contract is enforced through code recorded on a blockchain. By circulating and distributing the Tokamak Network TON tokens through a smart contract, we can not only prevent additional token circulation events from third parties, but also distribute the promised amount of tokens to token sale participants without unauthorized changes to the distribution timeline.

3. How Does the Token Swap Work

The token swap system will use a smart contract for token circulation and distribution.

3.1 Source and Target Token Swaps

Instead of creating all of the TON Tokens at once, the Tokamak Network Tokens (TON) will be created according to a structure in which they are divided as Source Tokens and Target Tokens, with the Source Tokens being exchanged for Target Tokens. For example, from August 2019 to August 2020 Tokamak Network conducted three rounds of private tokens sales. In each of these, a SeedTON, PrivateTON and StrategicTON was given to investors of each of these three rounds. Each of these separate categories of tokens are known collectively as Source Tokens, and each is made for a different use. They each can be considered redemption tickets for the Tokamak Network Target Token ,the TON.

The following is a list of the 9 types of Tokamak Network Source Tokens used in the swap system.

With the exception of the Marketing TON, all tokens have an exchange rate of 50:1.

The total supply for the Target Token TON is 50,000,000 TON, and these are stored in the smart contract that will operate in role of a vault. Each Source Token, through a swapper contract can be exchanged with TON that is stored in the Vault contract. All requests to withdraw TON Target Tokens must be submitted through the swapper, and there is no other method through which to withdraw TON from the Vault. When Source Tokens are sent to the swapper, a swap request is created and the swapper burns the Source Tokens it has received. It then withdraws Target Tokens (TON) from the Vault and distributes them to the user based on the vesting schedule.

If Source Tokens are lost, there is no method of receiving your TON Target Tokens. Additionally, in this process, because the primary has no method of interfering, lost Source Tokens cannot be redeemed as TON. Source Token holders should manage their tokens accordingly.

3.2 type1(VestingSwapper), type2(Swapper)

There are 2 functions with which to swap Source Tokens. A Type 1 Swap has a vesting function built in, and Type 2 Swap does not have this vesting function.

In order to activate the swap function of the vesting swapper, all Source Tokens that you hold must be deposited to the swapper. Through this “Source Token Deposit Ceremony” the vesting function built into the swapper can be activated.

3.2.1. Vesting and Vesting Cliff

Vesting is when tokens are distributed to holders over a set period of time. The vesting cliff identifies the start of the vesting period, when tokens begin being distributed. Before this, no tokens are distributed.

The Tokamak Swap System Vesting Model is a 30 day based Staircase Model. Every 30 days Source Token holders gain the right to exchange their Source Tokens for the relative amount of Target Tokens (TON.)

Image for post
Image for post

In the example graph above, 100 tokens are distributed over four periods, with 25 tokens being equally distributed over each period. The start of the distribution is the cliff when the first 25 tokens are distributed.

Within the Tokamak System, each Source Token has its own set vesting schedule, cliff and the number of Target Tokens to be exchanged. The details of this are outlined in this post.

3.2.2 MTON Vesting

Marketing TON is somewhat different. Through various events Marketing TON has been distributed to those who have assisted in the development of the network. These specific tokens can be swapped without a vesting period. The remaining Marketing TON will follow a separate vesting schedule.

The MTON distributed through events can be exchanged through the Type 2 Swapper. Because there is no vesting function, these tokens can be exchanged at any time. The remaining MTON that have not been used will be distributed through the Type 1 Vesting Swapper.

Through this method of using two swappers, the MTON vesting schedule and the amount vested will be distributed according to schedule.

3.2.3 DAO TON Swap

DAO Tokens cannot be swaped for TON until the end of 2020. 35% of the total Tokamak Network tokens are set aside for DAO governance, and the rules for these will be announced at the end of 2020. Accordingly,, these DAO tokens cannot be swaped until the DAO governance contract is built out.

3.3 Vault and Burner

The Vault is a contract that holds the unswapped TON. TON can only be withdrawn from the Vault using the predetermined Swapper.

The Burner is the contract that holds tokens. Tokens sent to this contract cannot be withdrawn. This can also be said to be a token grave. Source Tokens that have been swapped are deposited into the Burner and are no longer circulating.

3.4 Smart Contract Operation Process

3.4 The Presale-Contract Repository contains descriptions and the code for the Swap, Source Tokens and Target Token contracts. If you would like to confirm the code directly, this can be viewed in the repository. Those unfamiliar with technical details can skip this portion.

3.4.1 Contract Diagram

Image for post
Image for post

3.4.2 Swapper/VestingSwapper

Over a 30 day period, the VestingTokenStep.sol used by Source Tokens will utilize the Swapper.sol contract to exchange for the Target Token TON. Because the VestingToken.sol cannot vest tokens every 30 days, Vesting Swapper.sol, which contains the vesting function, must be used to swap for TON.

3.4.3 Swap flow detail

VestingToken.sol (seed/private/strategic)

Source Tokens made with the VestingToken.sol function can be swapped without a vesting function through the VestingSwapper.sol. In order to prevent misuse, all Source Tokens must be deposited into the VestingSwapper by calling the Deposit() function. The Deposit() function executes the approveAndCall() and registers required information for the Source Token Deposit() process in the VestingSwapper. Through the VestingSwapper’s swap() function, users can receive TON contained in the VestingToken.

VestingTokenStep.sol

Source tokens utilizing the VestingTokenStep.sol are vested every 30 days, and thus can use the swapper to receive their TON. Users tokens are swapped based on the vesting schedule by calling the Swapper contract swap( ), and this burns the Source tokens and returns the Target Tokens

MTON Distributed Through Events

Users can use the approve ( ) function to give the Swapper the right to move the users MTON. The Swappers swap ( ) function, when ran, will then move and burn the MTON, and return TON to the user.

Undistributed MTON

With the same method as the VestingToken, MTON is a simple ERC20 token, but has the difference of having the tokens all swapped at once. The process of locking the MTON is called with the MTON.approve( ), and VestingSwapper.receiveApproval( ) functions. After MTON are deposited into the VestingSwapper by calling the Deposit( ) function, they will be vested according to the schedule and are received when the VestingSwappers swap( ) function is called.

4. Additional Details

4.1 Method for Minting Additional TON

Additionally minting of TON is a permission that is used for staking and will be held by the Tokamak Network primary until the launch of TON staking. This new TON minting permission will be passed to the Seigniorage Manager Contract with the launch of TON staking in the third quarter of 2020, and only through staking will new TON tokens be minted. Until then, this permission will be maintained by the Tokamak Network team in a secure multi-signature wallet.

4.2 DAO TON Notes

The DAO governance, as outlined in the white paper and roadmap will be launched at the beginning of 2021 and at this time will determine how the DAO TON, 35% of the total TON supply, will be used. The Tokamak Swap System has a function to swap all DAO tokens at once, at the beginning of 2021. These tokens will be sent to the DAO governance Vault and will be managed by the DAO.

4.3 Second TONVault Manual Withdrawal before Removal

Before removing the permissions for the swiper and source tokens, two TONVault withdrawals were conducted. The details for each are listed below.

4.4 Token Contract Permission Burn Record.

5. Main Contracts and Primary Address

5.1 TON

5.2 SEED SALE

5.3 PRIVATE SALE

5.4 STRATEGIC SALE

5.5 Marketing TON

5.6 Other tokens

5.6 Additional Addresses

6. Main Contracts and Primary Addres

  1. Why are the Majority of Ton Stored in one Account known as the TON Vault?
    Instead of creating all TON tokens at once, Tokamak Network has divided these into Source Tokens and Target Tokens, with a system to exchange Source Tokens for Target Tokens. Accordingly, an account to securely store the TON during the vesting period is needed and this is the Vault. TON will be exchanged based on the ascribed vesting schedule and this can make it look like one account controls a large portion of the supply. But as time passes and tokens are vested through the swap, the TON in the Vault will be distributed to users over time.
  2. Can only a portion of my Source Tokens be Vested?
    Yes this is possible, but only the amount of tokens you have vested will appear in the vesting graph, and the Source Tokens not vested will not have their vesting options invoked.
  3. Can I send my Source Tokens?
    Yes, Source Tokens are standard ERC20 tokens. These can be sent to a different account you hold just as any token would.
  4. Can I stop vesting once it has started?
    Once tokens have been vested, this process cannot be stopped.
  5. I lost my wallet with my Source Tokens. Can I retrieve it?
    The Tokamak Network Primary account has had all permissions removed to prevent the creation/destruction of any tokens. Accordingly, any loss of tokens due t o carelessness cannot be recovered. Please be careful to not lose your account.
  6. Is the Swap Contract safe? Can it not be hacked?
    The Swap Contract has been inspected and tested multiple times by the Tokamak Network engineering team. Additionally, in order to identify any issues or problems we may have missed, Certik, a world renowned smart contract review team has also reviewed the contract.
  7. I am a token holder. Is there no easy web service to swap my tokens?The Tokamak Network team has made a Vesting Dashboard (http://vesting.tokamak.network) for Metamask wallet users. After connecting your Metamask account, you can easily interact with the vesting contract by following this dashboard guide. (link) There is no need to understand all of the details of the Swappers internal processes.
  8. The network fees for the Swapper Contract are expensive. Is there a way to save on fees?
    Because the token swap system and its smart contract are all built on the Ethereum blockchain, there is no way to avoid network fees. As the number of Ethereum users continues to rise, Ethereum network fees will rise with it. The best time to initiate the swap would be when Ethereum Network volume is low, as this will result in lower fees.
  9. Where can I get Source Tokens? Are Source Tokens Exchangeable?SeedTON, PrivateTON, and StartegicTON were distributed to investors 100&100 Capital, BloCore, Alphain Ventures, Skytale Capital and others after undergoing a KYC process. The resale of these tokens is contractually restricted. In the case of Marketing TON (MTON), these were distributed to individuals, but these are not listed on any exchange and are not being traded. The remaining Source Tokens are being held by the Tokamak Network team to be used for their specific purposes, and there is no plan to sell these.
    Because MTON distributed through events are ERC20 tokens, the Tokamak Network team cannot prevent the transfer of these between individuals. Accordingly, obtain MTON can be done by i) exchange them with someone who has participated in events, ii) participate in future events.
  10. Can I hold my Source Tokens without swapping them? What happens in this case?
    Source Tokens not swapped after 40 months following the opening of the vesting will no longer be able to be swapped.
  11. Can the Vault or Swapper be hacked?
    Please refer to FAQ question 6.
  12. What is the best method to securely store my Source Tokens?
    Because Source Tokens are standard ERC20 tokens, they can be stored in the same way with hardware or software wallets as Ethereum or other ERC20 tokens. It is advised to securely store your private key and/or seed phrase so that it is not lost or stolen. Additionally, only use proper software and a clean computer when interacting with your wallets.

Onther

Building an Ethereum Blockchain ECO system to Change the…

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store