A simple time-locked token wrapper system that allows users to lock tokens for a specified period.
TokenWrapperFactory - Creates new wrappers
- Auto-generates names with dates
- Quarter-based symbols (Q1, Q2, etc.)
TokenWrapper - The main wrapper contract
- Lock tokens for a specific time period
- No early withdrawals
- 1:1 exchange rate with underlying token after unlock date passes
Deploy wrapper:
- Call
deployWrapper(address, string, uint256)
with the underlying token address, prefix and unlock date (unix timestamp)
Lock tokens:
approve()
the wrapper contract- Call
wrap(amount)
Unlock tokens:
- Wait until unlock time
- Call
unwrapTo(recipient, amount)
from the token holder
See the broadcast directory to find the deployments.
forge test