Missing CRED registration enforcement → Stakers who forget to register receive 0 CRED on unstake (rewards silently destroyed).
Under normal behavior, staking for ≥ N days is expected to yield CRED rewards on unstake
. The function streets::unstake
computes days_staked
and mints 1 CRED per day threshold (up to 4) to the staker’s address.
It was observed that CRED account registration is not enforced before rewards are minted. In cred_token::mint
, coins are destroyed when the recipient is not registered for Coin<CRED>
, causing users who skipped registration to receive 0 CRED despite qualifying stake duration.
Likelihood:
New or returning users commonly omit token registration steps; the staking flow does not prompt or enforce registration before minting rewards.
Front‑end or wallet UX can fail to auto‑register, and no on‑chain guard exists; thus the condition occurs frequently in practice.
Impact:
Permanent reward loss: Stakers who qualified for rewards receive 0 CRED because rewards were destroyed, not queued or refunded.
Silent failure & user confusion: No event/error communicates that rewards were lost due to missing registration, degrading UX and trust.
Sequence:
1) User does NOT call cred_token::register.
2) User mints Rapper NFT, stakes it, waits >= 1 day.
3) User calls streets::unstake(...).
A defensive registration gate should be implemented so rewards are never destroyed for unregistered users. Several compatible options exist:
Enroll before rewarding (preferred, minimal change):
In streets::unstake
, ensure the staker is registered before calling mint
. If not, register them using the staker’s signer (available as &signer
).
Fail fast instead of destroying:
In cred_token::mint
, abort with a clear error when to
is not registered, preventing silent loss and signaling front‑end fixes.
Escrow pending rewards (optional, UX‑friendly):
Accumulate rewards in a PendingRewards
table keyed by address when unregistered, claimable after registration.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.