The server monitors the DAO contract events and saves event data in the database. With this it creates an aggregate event log and distributes seigniorage to based on the amount of tokens staked. It also includes the API server that manages DAO data providing functions to enable usage of the DAO web and APP interfaces.
The DAO system is structured as follows:
The server saves a log of contract events, and uses these for analysis and operations. The events monitored are as follows, and they are stored in the database.
DAOCommittee Contract
( 1 ) Committee Events
event CandidateContractCreated ( address indexed candidate, address indexed candidateContract, string memo ) Candidate Creation Event
Candidates create a candidateContract and through this are provided the functions (Committee Support, Agenda Voting, Member Activity Reward, Committee Resignation) that are available to Candidates.
Candidate can be designated in the Dao web and app with a memo value.
event OperatorRegistered( address indexed candidate, address indexed candidateContract, string memo )
Layer2 Candidate Registration Event
Can operate as a Tokamak Network Layer 2 Candidate. The Layer2 staking tokens are added to the Candidates vote count.
When registering, a Candidate can be designated in the Dao web and app with a memo value.
event ChangedMember( uint256 indexed slotIndex, address prevMember, address indexed newMember )
Committee Member Change Event
event ChangedSlotMaximum( uint256 indexed prevSlotMax, uint256 indexed slotMax )
An event that provides a notification that the slotMax has been changed from the prevSlotMax.
event ClaimedActivityReward( address indexed candidate, address receiver, uint256 amount ) An event when a Candidates activity reward is provided to a receiver.
When a Candidate is Layer2, a receiver becomes a layer2 operator.
( 2 ) Agenda Event
****event QuorumChanged( uint256 newQuorum )
An event when the threshold vote number is determined for an event.
An event when a number of votes exceeds newQuorum, then the Agenda results are counted.
event AgendaCreated( address indexed from, uint256 indexed id, address[] targets, uint256 noticePeriodSeconds, uint256 votingPeriodSeconds )
An Agenda creation event. from calls targets with the id, which creates an Agenda. This Agenda can be executed after notice period (noticePeriodSeconds) and voting period (votingPeriodSeconds) are concluded.
event AgendaVoteCasted( address indexed from, uint256 indexed id, uint voting, string comment )
Agenda Voting Event
from this agenda(id) voting (Vote 0:Abstain, 1:Yes, 2:No) are executed. When voting, comments can be added.
event AgendaExecuted( uint256 indexed id, address[] target ) Agenda Execution Event Executes the Agenda id contract(target) function.
DAOAgendaManager Contract
event AgendaStatusChanged( uint256 indexed agendaID, uint256 prevStatus, uint256 newStatus )
Agenda Status change event Occurs when an Agenda status is changed. agendaID displays the Agenda previous status.
Status Code 0:NONE, 1:NOTICE, 2:VOTING, 3:WAITING_EXEC, 4:EXECUTED, 5:ENDED
event AgendaResultChanged( uint256 indexed agendaID, uint256 result )
Agenda Result Change Event Occurs when an Agenda result is calculated. Displays agendaID Agendas result.
Result Code: 0: PENDING, 1: ACCEPT, 2: REJECT, 3: DISMISS
DepositManager Contract
event Deposited(address indexed layer2, address depositor, uint256 amount)
An event that occurs when staking to Tokamak Network Layer2 or voting for a DAO Candidate.
event WithdrawalRequested(address indexed layer2, address depositor, uint256 amount) An event that occurs when unstaking from Tokamak Layer2 or Unvoting from a DAO Candidate.
event WithdrawalProcessed(address indexed layer2, address depositor, uint256 amount)
An event that occurs when withdrawing from Tokamak Network Layer2 or a DAO Candidate.
SeigManager Contract
event SeigGiven(address indexed layer2, uint256 totalSeig, uint256 stakedSeig, uint256 unstakedSeig, uint256 powertonSeig, uint256 pseig)
Seigniorage Creation Event
event Comitted(address indexed layer2) Layer 2 (Candidate) Seigniorage Distribution Event Layer 2(Candidate) Operator(Candidate) commissions are applied and Layer 2 operators(Candidate) and delegators(Voters) are distributed seigniorage.
event CommissionRateSet(address indexed layer2, uint256 previousRate, uint256 newRate) Changing layer2 commission rate event.
WTON Contract
Transfer(address(0), account, amount)
WTON transfer event.
When a staking event occurs in order to determine the amount of tokens staked by user of the Tokamak Network Staking Service, a users total staking amount is queried and recorded. This record provides information on the total number of tokens staked as well as the ranking of stakers.