-
Notifications
You must be signed in to change notification settings - Fork 79
SuperAdmin Nomination in Two-Step Transfer Is Not Time-Limited, Allowing Permanent Pending State #111
Description
Description
The two-step SuperAdmin transfer (nominate → accept) stores a pending nominee indefinitely. If the nominated address never calls accept_super_admin, the nomination sits in storage forever. Worse, the current SuperAdmin cannot cancel the nomination — they are blocked from nominating a different address because a pending nomination already exists.
Fix Requirements
Add a nominated_at timestamp and nomination_expiry (default: 24 hours) to the nomination storage entry
accept_super_admin must check that env.ledger().timestamp() <= nominated_at + nomination_expiry — return ContractError::NominationExpired if not
Add a cancel_nomination(env) function callable by the current SuperAdmin that clears any pending nomination
Expired nominations are also cleared lazily when a new nominate_super_admin call is made
Acceptance Criteria
Nominations expire after 24 hours (configurable via a constant)
accept_super_admin after expiry returns ContractError::NominationExpired
cancel_nomination clears the pending nomination and allows a new nomination immediately
A new nomination replaces an expired pending nomination without error
Tests cover: successful transfer, expired nomination attempt, cancel and re-nominate