Description:
In the pool.cairo contract (apps/staking/contracts/src/pool/pool.cairo), if a user calls exit_delegation_pool_intent(amount) with the same amount as previously submitted, the contract resets the cooldown timer (unpool_time), even though the intent hasn’t changed.
Real case:
A user submitted exit_delegation_pool_intent(2000 STRK) and waited 21 days.
After that, due to a front-end issue or accidental double click, they unintentionally submitted the same intent again with the same amount (2000 STRK).
Now, instead of exiting after 21 days, they will wait another 21, resulting in 42 days total.
Expected behavior:
If amount == current unpool_amount, the contract should:
Skip updating unpool_time, or
Return an error like INTENT_ALREADY_EXISTS
This prevents unnecessary cooldown resets and protects user experience from front-end bugs or accidental submissions.
Description:
In the pool.cairo contract (apps/staking/contracts/src/pool/pool.cairo), if a user calls exit_delegation_pool_intent(amount) with the same amount as previously submitted, the contract resets the cooldown timer (unpool_time), even though the intent hasn’t changed.
Real case:
A user submitted exit_delegation_pool_intent(2000 STRK) and waited 21 days.
After that, due to a front-end issue or accidental double click, they unintentionally submitted the same intent again with the same amount (2000 STRK).
Now, instead of exiting after 21 days, they will wait another 21, resulting in 42 days total.
Expected behavior:
If amount == current unpool_amount, the contract should:
Skip updating unpool_time, or
Return an error like INTENT_ALREADY_EXISTS
This prevents unnecessary cooldown resets and protects user experience from front-end bugs or accidental submissions.