Supply Is a Set of Powers, Not a Number
Use a virtual token to separate minting, allocation, vesting, and claims—and watch who retains the power to change supply.
- Separate total, liquid, and locked supply
- Explain why mint authority changes holder risk
- Observe how vesting claims affect allocation and circulation
- PREVIOUSCourse introduction
- CURRENTSupply Is a Set of Powers, Not a Number
Use a virtual token to separate minting, allocation, vesting, and claims—and watch who retains the power to change supply.
- NEXTWhen Does a Promise of Future Tokens Become Liquid?
Think about these questions first.
Choose an answer before opening the explanation. You can add anything unexpected to your review list.
Q01Total supply is one billion. Why might only ten million be sellable?+
Total supply includes vesting contracts, treasuries, and undistributed balances. Price meets circulating inventory and order-book depth, so total supply can overstate immediate supply.
A token is not just a number that can grow. It is a public promise about who can change what. Start with a minimal balance table and separate supply, authority, allocation, and time before copying an ERC-20 contract.
Separate three kinds of supply
This LAB starts with 1,000,000 total units and a 1,200,000 maximum. 600,000 LAB is already liquid in creator, community, and treasury balances; another 400,000 LAB is recorded in vesting schedules.
- Total supply: every LAB the state machine recognizes, including locked units.
- Liquid supply: balances that can be transferred, traded, or used now.
- Locked supply: allocated units that need time and a claim action before becoming liquid.
LAB / Virtual token
Every action changes a public state table. Ask who can change supply, who can claim, and who absorbs dilution.
Locked units count toward total supply but cannot transfer yet. Color is secondary; numbers and labels are the state.
Start with the supply map: liquid balances, locked balances, and the mint authority are separate state variables.
- 02
Initial allocation recorded:创建者、社区、国库余额可用;另外 400,000 LAB 处于锁仓.
- 01
LAB created:总供应 1,000,000, 供应上限 1,200,000, 创建者保留增发权限.
Use the slider to return to an earlier step. Continuing from there replaces the later history with a new sequence.
Maximum supply and mint authority are different gates
The maximum supply answers “how many can ever exist?” Mint authority answers “who can write new units into the balance table?” Even when total supply is unchanged today, a creator who still holds mint authority remains part of the trust model.
Expand: how this step works
mint(to, amount):
require(msg.sender == mintAuthority)
require(totalSupply + amount <= maxSupply)
balance[to] += amount
totalSupply += amount
claimVesting(holder):
unlocked = schedule.total × phase / 100%
amount = unlocked - schedule.claimed
balance[holder] += amount
schedule.claimed += amount
Production contracts also handle multisig authority, pauses, upgrades, reentrancy, rounding, and governance changes. This lab keeps the code short so every state change stays inspectable.
After mint authority is revoked, what happens when vesting advances and a holder claims?
Four questions for reading a token
- What are total supply and maximum supply right now?
- Which balances are liquid, and which remain on a vesting schedule?
- Who can still call mint, and did revoking authority change that rule?
- Which fields change after a transfer, a claim, and a mint?