All about Tokamak DAO (2) [EN]

Tokamak DAO smart contract

Onther
Onther
Apr 2 · 7 min read
Tokamak DAO Smart Contract

(1) What is Tokamak DAO

(2) Tokamak DAO smart contract <- Here

(3) DAO user interface and its use

(4) FAQ

Index

  • Abstract
  • Contract overview
  • Election
  • DAO Committee
  • Proposal
  • DAO Vault
  • Others

Abstract

Tokamak DAO is a system for making decisions about various things that affect the Tokamak Network ecosystem. This post explains how the Tokamak DAO smart contract system works in detail and how users can contribute to the ecosystem.

Contract overview

DAO contracts have the authority of almost all contracts related to the Tokamak Network and have the authority to execute functions that change the state value of each contract. Specifically, in order to change the state, the user creates an agenda for the function execution in Tokamak DAO, and then the committee’s decision is made, and the execution is decided according to the result of the committee decision.

The DAO Contract controls the status of the agenda such as the management of qualifications for the members of the DAO Committee, proposals, and voting of agendas. In addition, functions such as voting for DAO candidates are designed to incentivize voters for rewards from voting by utilizing the existing Tokamak Network staking contract.

This post will explain the composition, role, and functional characteristics of the DAO contract.

Election

All users can vote for any DAO candidate. Since this voting takes the form of depositing TON, users can vote for that candidate by depositing TON on the same candidate. Since these TON deposits use the Tokamak Network’s staking contract, voters can get rewards proportional to the TON they voted for.

The amount of votes received by a DAO candidate equals the total amount of TON delegated to that candidate. This voting amount includes the amount deposited by the candidate himself/herself.

The user’s vote for candidates is the same as the structure of staking, so all of the functions below are managed by the Tokamak Network staking contract. For more information on Tokamak Network staking service, please refer to this article.

Vote

Users can vote by delegating TON to any DAO candidate. TON delegation is managed by the contract that manages the staking service of Tokamak Network, and you can get rewards in proportion to the amount and duration of the delegation.

Unvote

This is the procedure for requesting the release of the TON voted for a DAO candidate. When the vote is canceled, withdrawal is not made immediately and can be withdrawn after a certain period (currently 14 days) after requesting. This period value is identical to the one managed by Tokamak Network staking contract.

Revote

After requesting to unvote, you can still vote again for TON that have not yet been withdrawn. It is like re-staking of the Tokamak Network staking service.

Withdrawal

This is the procedure to withdraw the TON requested for unvote. You can withdraw after a certain period (currently 14 days) after the request.

DAO Committee

The DAO Committee of Tokamak Network is managed by a Committee contract. The Committee provides functions related to other tasks such as registration of candidates, management of member addition, change, removal, etc., and registration and execution of agendas.

The AO Committee can be defined as an organization with substantial voting rights on Tokamak DAO agendas. Tokamak Network DAO Committee is managed by a Committee Contract. The Committee Contract performs the main functions of DAO, such as registering candidates, adding, changing, and removing members, and registering and executing agenda.

Delegator

  • Voting on candidates (TON delegation)

All users can delegate (deposit) TON to any candidate of their choice and receive interest (newly issued TON, seigniorage) managed by the SeigManager contract.

  • Agenda creation

All users can create an agenda by consuming a certain amount of TON as a fee.

Candidate

Anyone can register as a candidate, and Layer 2 contracts managed by the SeigManager contract can also be registered as candidates. All candidates can use SeigManager contract features such as function updateSeigniorage() and adjusting commission rates.

All candidates can interact with the DAO contract through the Candidate contract. If the candidate is a Layer 2 contract, the operator can use the Candidate contract.

  • Layer 2 and DAO candidate

It is also possible to register as a DAO candidate while the Layer 2 contract has already been registered. In this case, Layer 2 can operate as a multiple candidate while operating Layer 2. At this time, the management of Layer 2 and the activities as a candidate for DAO will be conducted by the Layer 2 operator.

In addition, the TON delegated to the Layer 2 contract is considered as the amount voted for the DAO candidate.

Committee Member

  • Member Slot

The DAO contract has as many seats as the maximum number of members. The initial slot is assigned ZERO_ADDRESS, and each candidate can change members if they meet the criteria for selection of members.

  • Member selection criteria

The amount of votes for the candidates is equal to the amount of TON each candidate has been delegated. This vote is managed by the SeigManager contract, and the amount includes the amount deposited by the candidate himself.

  • Member replacement

If the number of votes for the candidate (the amount of TON deposited) is greater than the number of votes of a specific member, the candidate can occupy the slot of that member through the Candidate contract.

Proposal

  • Agenda proposal

Each agenda refers to an agenda that executes a specific function of specific contracts with a specific parameter, and these values are entered by the agenda creator when creating the agenda.

Anyone can create an agenda, and it burns a certain amount of TON as an agenda creation fee. This fee is currently 100 TON and can be adjusted.

  • Agenda voting process

The agenda starts its notice period from the time it is created. It has a voting period after the notice period ends. The notice period and voting period have minimum values, and can be set when creating an agenda. Also, a passed agenda has an execution period, which can only be executed within the execution period and cannot be executed after it expires. The execution period has a common value for all agendas.

During the notice period, there is no change in the status of the agenda, and after the end of the notice period, the agenda member is determined by the committee member at the time the transaction occurs. Only members of the agenda can vote on the agenda, and the voting period begins when the first voting transaction occurs after the notice period.

During the voting period, voters can vote on the agenda. Voting is done in yes/no/abstain, and the voting result is changed when the quorum is satisfied. If the vote is confirmed by filling the quorum, the passed agenda cannot be executed immediately but after the voting period is over.

Passed agendas have a certain period of execution after the voting is over. Anyone can execute the agenda within the execution period and change the contract status of Tokamak Network according to the agenda.

DAO Vault

Source

DAO vault contains tokens that can be used through DAO. The tokens entering the vault include the amount allocated for part of the total issuance of TON (35% of the initial issuance), and part of the seigniorage (additional issuance) issued from Tokamak Network staking.

Approve

The agenda allows you to approve the tokens stored in the Vault. Target token is TON, WTON or token with token address entered.

Through the agenda, you can execute the function approve() on the tokens stored in the vault. Target token is TON, WTON or token with token address entered.

Claim

Tokens stored in the vault by agendas can be withdrawn immediately. Target token is TON, WTON or token with token address entered.

Others

DAO candidate / Members / Voters by agenda

Below is a schematic diagram of the relationship between DAO candidates, members, and voters by agenda.

At the bottom of the diagram, different committee members are assigned to each agenda, and you can see the voting process accordingly.

Proxy pattern and upgradeable functions

Tokamak DAO is designed in consideration of the possibility of functional expansion and upgrade during the deployment and operation of the contract. The DAO Committee management contract is based on the DAO proxy pattern, which separates storage and logic.

Users can access DAO committee and basic services through the DAOCommitteeProxy contract. The DAOCommitteeProxy contract address is directly exposed to users and is managed as an address that does not change during service.

By using the function upgradeTo() in the DAOCommitteeProxy contract, you can expand and upgrade the DAO service by changing the address of the DAOCommittee contract in charge of the DAO service logic. Based on these structural features, DAO is expected to provide a more user-friendly and proactive user experience by allowing maintenance and upgrades to proceed smoothly without service interruption even in the process of using the contract.

Contract Diagram

Diagrams of the all DAO service contracts are as follows.

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