Summary
Holding keys and staking keys are different levels of commitment. A holder who locks their keys for a period signals they are not selling — which is valuable information for creators and other buyers. The contract should track staked vs liquid balances per holder and expose the staking status so the client can display loyalty tiers based on how long and how many keys a wallet has staked.
Scope
- Add
stake_keys(creator_id, amount: u32, lock_ledgers: u32) function
- Moves
amount from the holder's liquid balance to their staked balance
- Records
unlock_ledger = current_ledger + lock_ledgers
lock_ledgers must be at least a configurable minimum (e.g. 1000 ledgers ≈ 83 minutes)
- A holder can have multiple stake positions for the same creator
- Add
unstake_keys(creator_id, stake_id) function
- Reverts with
StillLocked if current ledger is before unlock_ledger
- Returns keys to liquid balance on success
- Staked keys cannot be transferred or sold — attempts revert with
KeysStaked
- Add
get_stake_positions(creator_id, wallet) -> Vec<StakePosition> view returning each position: { stake_id, amount, unlock_ledger }
- Add
get_liquid_balance(creator_id, wallet) -> u32 view returning only the unstaked balance
Acceptance Criteria
ETA: 24 hours
Coordinate on Telegram
Summary
Holding keys and staking keys are different levels of commitment. A holder who locks their keys for a period signals they are not selling — which is valuable information for creators and other buyers. The contract should track staked vs liquid balances per holder and expose the staking status so the client can display loyalty tiers based on how long and how many keys a wallet has staked.
Scope
stake_keys(creator_id, amount: u32, lock_ledgers: u32)functionamountfrom the holder's liquid balance to their staked balanceunlock_ledger = current_ledger + lock_ledgerslock_ledgersmust be at least a configurable minimum (e.g. 1000 ledgers ≈ 83 minutes)unstake_keys(creator_id, stake_id)functionStillLockedif current ledger is beforeunlock_ledgerKeysStakedget_stake_positions(creator_id, wallet) -> Vec<StakePosition>view returning each position:{ stake_id, amount, unlock_ledger }get_liquid_balance(creator_id, wallet) -> u32view returning only the unstaked balanceAcceptance Criteria
unlock_ledgerreverts withStillLockedunlock_ledgerreturns keys to liquid balanceKeysStakedKeysStakedget_stake_positionsreturns all active positions for a walletget_liquid_balancereturns only unstaked keysETA: 24 hours
Coordinate on Telegram