Mainnet locks
Overview
High-level description of Token lock-ups and restrictions can be found here. This document defines technical detail on how it was implemented in chain.
Detailed Mainnet locks spec
Tokens in certain accounts will be restricted (locked) and that restriction will unwind over a period of time according to a schedule defined for each type of lock. All locks types and schedules will be hard coded and can only be applied at Mainnet launch. There will be 4 types of locks:
Type 1
Locked tokens cannot be transferred, voted or proxied until unlocked per schedule.
Voting/proxying minimum override. When restricted account is voting the unlock schedule is computed and if unlocked tokens are less than 30% of initial grants, the user can still vote 30% of tokens in initial grant or account balance whichever is lower.
Restricted calls:
/transfer_tokens_pub_key
/vote_producer
/proxy_vote
Locked tokens can be used to pay for FIO Protocol fees
Schedule
Day 0: 0.00%
Day 90: 6.00%
Day 270: 18.80%
Day 450: 18.80%
Day 630: 18.80%
Day 810: 18.80%
Day 990: 18.80%
Application: Founders (Dapix investors, employees, advisors)
Type 2
Locked tokens cannot be transferred until:
Unlocked per schedule
Designated by Foundation as having launched FIO Protocol integration
Restricted calls:
/transfer_tokens_pub_key
100% of locked tokens can be voted and proxied and used to pay for FIO Protocol fees until the following condition is met:
210 days have passed since Mainnet launch and account has not been designated by Foundation as having launched FIO Protocol integration.
Schedule
Day 0: 0.00%
Day 90: 6.00%
Day 270: 18.80%
Day 450: 18.80%
Day 630: 18.80%
Day 810: 18.80%
Day 990: 18.80%
Application: FIO Member incentives
Type 3
Locked tokens cannot be transferred until unlocked per schedule.
100% of locked tokens can be voted and proxied at all times
Restricted calls:
/transfer_tokens_pub_key
Locked tokens can be used to pay for FIO Protocol fees
Schedule
Day 0: 0.00%
Day 90: 6.00%
Day 270: 18.80%
Day 450: 18.80%
Day 630: 18.80%
Day 810: 18.80%
Day 990: 18.80%
Application: Pre-sale investors
Type 4
Locked tokens can never be transferred or voted
Restricted calls:
/transfer_tokens_pub_key
/vote_producer
/proxy_vote
Locked tokens can only be used to pay for FIO Protocol fees
Application: FIO Address Giveaways post Mainnet
Implementation
Each restricted account will store
Total grant amount - recorded once at Genesis
Schedule periods unlocked - updated each time schedule is processed for new period
Lock type - See above
Unlock inhibit flag - if set all funds are considered locked irrespective of schedule (only used for Type 2)
Amount locked - amount which remains locked
Every time a restricted call is made the signer's account on that call will be checked against list of restricted accounts
If account is not restricted, action proceeds uninterupted
If account is restricted
If Type 4
Transaction fails with 400:Insufficient balance
If Type 2 and Unlock inhibit flag is set
Transaction fails with 400:Insufficient balance
Compute unlocked tokens
Based on days since Mainnet determine number of schedule periods that should be unlocked
Example:
Type 1, 180 days after Mainnet
3 periods should be unlocked
Based on Schedule periods unlocked determine how many periods should be unlocked
Example:
Type 1, 180 days after Mainnet, Schedule periods unlocked = 1
2 periods should be unlocked
If 0 periods no new tokens should be unlocked
If > 0 unlock tokens based on corresponding period percentage
Example:
Type 1, 180 days after Mainnet, Schedule periods unlocked = 1
12.375% + 12.375% = 24.75% should be unlocked
Update Schedule periods unlocked and Amount locked
Example:
BEFORE: Total grant amount = 100, Schedule periods unlocked = 1, Amount locked = 99
AFTER: Total grant amount = 100, Schedule periods unlocked = 3, Amount locked = 74.25
Determine Unlocked tokens
Subtract Amount locked from account balance
Example:
Amount locked: 74.25
Account balance: 100
Available tokens: 100 - 74.25 = 25.75
Determine Votable Tokens
If Type 1
If 1 - (Amount locked / Total grant amount) <= 0.3 then Votable Tokens is lesser of Account balance or Total grant amount * 0.3
If 1 - (Amount locked) / Total grant amount) > 0.3 then Votable Tokens is Available tokens
If Type 2
If 210 days have passed since Mainnet and Unlock inhibit flag is set, Votable Tokens = Amount balance - Amount locked; else Votable Tokens = Account balance
If Type 3
100% is votable
If /transfer_tokens_pub_key
If amount is > Available tokens it fails with 400:Insufficient balance
If amount is <= Available tokens, action proceeds uninterupted
If /vote_producer or /proxy_vote
Only Votable Tokens are voted or proxied;
If Votable Tokens = 0 transaction fails with 400:Insufficient balance
If paying a FIO Protocol fee and fee is > than Available tokens Amount locked should be reduced by the difference between Available tokens and Amount locked
Example:
Locked tokens: 74.25, Account balance: 100, Available tokens: 25.75
Fee: 30
Locked tokens updated to: 74.25 - (30 - 25.75) = 70
Foundation
Foundation account will be designated at Mainnet launch. This account:
Will receive funds issued to Foundation as defined in Fee Distribution - Foundation
Will be the only account allowed to set Unlock inhibit flag as defined in Token lock mechanism
Setting Unlock inhibit flag
The unlock inhibit flag will be set using the action
inhibitunlck (name: owner, uint32_t value)
on the system contract. the owner must be the name of the fio account affected, the value should be the desired value of he inhibit_unlocking flag, 0 for false, non zero for true.
Only Foundation account is allowed to make this call
This call ha no fee
If 210 days have passed since Mainnet launch, this call will generate 400:Unlock inhibit flag can no longer be removed