DAICO Open-source Framework, Part 2: Deployment and Operation Flow

DAICO Open-source Framework, Part 2: Deployment and Operation Flow

In this part 2 of the series, we will talk about a deployment and operation flow of the DAICOVO. If you were going to use our contracts as it is, you can operate it by simply following the operation flow below.

 

We will cover the whole process in order: before the token sale, during the token sale, after the token sale, voting period and after the approval to the proposal.

Until the Initial Token Distribution

  • Deploy the DaicovoStandardToken contract.

You may use your own ERC20 compatible token. But in that case, you need to inherit Mintable and Ownable contracts.

 

  • Register your white paper to WhitepaperVersioning contract(optional).

This is optional. You don’t need to use this contract unless you want to execute your ICO on top of ICOVO platform. This contract prevents project owners from tempering with their white paper.

 

WhitepaperVersioning has an instance globally. You register your white paper on this instance. To be more specific, you register the white paper itself on IPFS and add the hash to the WhitepaperVersioning contract. This way, you can trace the change history. You can update the white paper every time you execute pushWhitepaper( ).

 

_contract should be Ownable and only the owner can register initially. For further updates, you can register from the address you registered first. This means that the initial registrar will have the authority to update for good even if the owner of _contract change later on.

 

  • Deploy the TokenController contract.

 

  • Transfer the ownership of the token.

You change the owner to the TokenController by executing thetransferOwnership() function. The WhitepaperVersioning should be taken care of before this process because it changes the owner. After this change, the TokenController will be in charge of issuing tokens.

 

  • Issue tokens via the TokenController contract.

They can distribute the tokens that will be allocated to their team members or marketing expenses. If you were to have closed sales, you can distribute them here.

*Beware that the project owner cannot distribute anymore once the crowd sale has started

 

If you want to lock up a certain amount of tokens, send them to the TimeLockPool.

Make sure you give permission to the TimeLockPool with approve() function in the token contract before you deposit tokens to the TimeLockPool contract.

 

The Preparation for the Token Sale

  • Deploy the DaicoPool contract.

The Voting contract will be deployed in the constructor.

 

  • Deploy the TokenSaleManager contract.

 

  • Set up your token sale in TokenSaleManager.addTokenSale(…).

Assign value to each parameter of the token sale.

 

  • initialize() in the TokenSaleManager contract.

You can fix the setting of your token sale by running initialize().

 

  • Execute OpenTokenSale() in the TokenController contract.

This transfers the authority to issue tokens to the TokenSaleManager. The project owner cannot distribute tokens anymore.

 

Everybody can check the distribution of tokens before the sale. Thus, investors can make sure if the project owner keeps the promise written in the white paper before they participate in the sale.

 

  • Whitelist

Whitelist the KYC’d addresses with TokenSaleManager.addToWhitelist(or addManyToWhitelist). Only the whitelisted users/addresses can purchase tokens(You can update the whitelist later).

 

*We have designed the contract in a way that all the processes after the token sale will progress in a trustless manner: even the project owner cannot change the content of the sale or shut down the operation. The token sale will start in such a way that all the processes are clear to everybody.

During The Token Sale

  • The sale starts

The sale will be open when the start date and time you set up in the first TokenSale comes.

 

  • The investors buy tokens

The whitelisted investors can receive tokens in exchange with ETH by sending them to the TokenSale contract. The transaction fails if they don’t send more than the minimum amount.

 

  • Finalize the token sale

When the end date and time comes or when all the tokens were sold, you can finalize the TokenSale with TokenSaleManager.finalize(uint256 index). Everybody can finalize the sale.

 

The funds in the TokenSale contract will be sent to the DaicoPool contract with the finalization(You can finalize as many times as needed in case some funds are left in the TokenSale contract for some reasons). The finalization also initialize the next TokenSale.

In case you set the carryover true, the unsold tokens will be carried over to the next TokenSale.

 

  • finalize the TokenSaleManager.

You can execute TokenSaleManager.finalizeTokenSaleManager() when all the TokenSale contracts were finalized. Everybody can execute this function just like the finalization of each TokenSale contract.

 

The tap opens in the DaicoPool, which release the initial funds and start releasing the amount you set up as the tap amount. Also, token holders can make a proposal from this point.

After The Token Sale

  • The project owner withdraws money from the pool

The amount of money you can withdraw increases every second depending on the amount of tap you set up. Only the project owner can withdraw this fund.

 

  • Make a proposal

At this point, everybody can make a proposal by sending a certain amount of ETH. There are two kinds of a proposal in the current version: the tap raising and the self-destruction.

 

Once the proposal is made, it immediately moves onto the voting period. The DaicoPool continues to release the funds during the period, and the project owner can still withdraw their funds.

During The Voting Period

The 14 days of voting period starts once somebody makes a proposal.

  • Vote

The token holders can either agree or disagree with the proposal by depositing their tokens to the Voting contract. Before voting, they need to give permission to the Voting contract to spend on behalf of them with approve()function.

 

  • finalize the voting.

When the voting period ends, everybody can finalize the Voting. When the conditions are met to pass the proposal, it sends either the RaiseTap or SelfDestruction signal to the DaicoPool contract. When the conditions are not met, nothing happens except the ending of the voting period.

 

  • Refund the tokens

After the finalization, the voters can get their tokens back. To be more specific, they can execute returnToken() function in the Voting contract. Everybody can execute this function but it will always refund to the original token holders.

 

After The Self-destruction Proposal Is Passed

  • Self-destruction

If the proposal of a self-destruction garners support from a majority, the DaicoPool contract immediately turns off the tap after it releases the fund of 30 days to the project owner. This fund is released to allow the project owner to pay expenses for a month. Once the tap is turned off, token holders can take back their money.

 

  • More precisely, token holders can receive money from the funds left in exchange with their tokens.

You can calculate the money you will receive with the equation below.

 

The funds left in DaicoPool * the number of tokens you exchange / total supply

 

Before executing the refund(), you need to give permission to the DaicoPoolcontract to spend on behalf of you with the approve() function in the token contract.

 

For the upcoming posts, we will talk about the implementation of each contract.

 

 

Profile

Takuya Obata

Chief Operating Officer at ICOVO AG. And a blockchain engineer at the same time. He got MVP in Blockchain Hackathon Tokyo 2016. He is also experienced in natural language processing and chess like game programming.