cancelPromotion is too rigorous
The cancelPromotion function deletes the entire promotion record, so users can no longer claim rewards from previous epochs and unclaimed tokens remain locked in the contract.
Submitted by gpersoon, also found by 0x0x0x, gzeon, harleythedog, hubble, and kenzo
Impact
When you cancel a promotion with cancelPromotion() then the promotion is complete deleted. This means no-one can claim any rewards anymore, because \_promotions\[\_promotionId] no longer exists.
It also means all the unclaimed tokens (of the previous epochs) will stay locked in the contract.
Proof of Concept
function cancelPromotion(uint256 _promotionId, address _to) ... {
...
uint256 _remainingRewards = _getRemainingRewards(_promotion);
delete _promotions[_promotionId];
Recommended Mitigation Steps
In the function cancelPromotion() lower the numberOfEpochs or set a state variable, to allow user to claim their rewards.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the cancelPromotion function deletes the entire promotion data structure instead of marking it as cancelled or adjusting the number of epochs, which removes the information needed to claim past rewards.
Impact
Users lose access to unclaimed rewards from previous epochs, and those tokens remain permanently locked in the contract.
What the attacker needed
Promotion must be cancelled by owner
The fix
The cancelPromotion function should be modified to lower the numberOfEpochs or set a state variable so that users can still claim their rewards.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract lets people earn rewards over time. If the owner cancels the promotion, the contract erases all record of it, so people who already earned rewards cannot collect them and their tokens are stuck forever.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.