The token locking mechanism allows users to lock a portion of their tokens based on the current market cap. Each user can lock up to 30% of their total tokens, but they are restricted to locking their tokens once per "quantum cap slab." A quantum cap slab is defined as a specific market cap threshold that must be crossed before additional locking is permitted.
-
Maximum Locking Percentage: Users can lock up to 30% of their total tokens.
-
Locking Restriction: Users can only lock their tokens once between each quantum cap slab. Once the market cap passes the next threshold, users can lock more tokens.
-
Quantum Cap Slab: Represents a market cap milestone that allows users to lock tokens. Users can lock more tokens only after the market cap surpasses the next slab.
initialize(initialMarketCap, quantum)
initialMarketCap: 10,000,000 units (starting market cap)
quantum: 1,000,000 units (increment for next burn cap)
current_cap: 10,000,000 units
next_burn_cap: 11,000,000 units (current_cap + quantum)
quantum: 1,000,000 units
Admin mints 1,000 tokens to their own token account.
Admin mints another 1,000 tokens to the user's token account.
adminTokenAccount: 1,000 tokens
userTokenAccount: 1,000 tokens
- Admin transfers 500 tokens from their account to the user's token account.
adminTokenAccount: 500 tokens
userTokenAccount: 1,500 tokens
- User can lock up to 30% of their token balance.
- Maximum Lockable Amount: 30% of 1,500 tokens = 450 tokens.
- User locks 450 tokens, transferring them from userTokenAccount to - vaultTokenAccount.
adminTokenAccount: 500 tokens
userTokenAccount: 1,050 tokens (1,500 - 450)
vaultTokenAccount: 450 tokens (locked)
- Simulate token value growth by updating the market cap.
- New Market Cap: current_cap + quantum = 10,000,000 + 1,000,000 = 11,000,000 units.
current_cap: 11,000,000 units
next_burn_cap: 12,000,000 units (incremented by quantum)
- PDA (vaultAuthorityPda) is set as the authority for the vaultTokenAccount.
- This enables PDA to later burn the tokens in the vault.
vaultTokenAccount authority: vaultAuthorityPda
- After a 2-minute delay, the 450 tokens in the vaultTokenAccount are burned.
adminTokenAccount: 500 tokens
userTokenAccount: 1,050 tokens
vaultTokenAccount: 0 tokens (450 tokens were burned)
- Initialization:
current_cap: 10,000,000 units
next_burn_cap: 11,000,000 units
quantum: 1,000,000 units
-
Minting:
- Admin and User each receive 1,000 tokens.
-
Transfer:
- Admin transfers 500 tokens to User.
adminTokenAccount: 500 tokens
userTokenAccount: 1,500 tokens
- Locking:
- User locks 450 tokens in the vault.
adminTokenAccount: 500 tokens
userTokenAccount: 1,050 tokens
vaultTokenAccount: 450 tokens
- Market Cap Update:
- New current_cap: 11,000,000 units.
- New next_burn_cap: 12,000,000 units.
- Burning (After 2 Minutes):
- The 450 tokens in the vault are burned.
adminTokenAccount: 500 tokens
userTokenAccount: 1,050 tokens
vaultTokenAccount: 0 tokens