When a config is removed for activated but still in cooldown period auctions the contract fails to deduct its totalAuctionTokenAmount
from _totalAuctionTokenAllocation
, which leads to funds being stuck permanently in the contract.
When an auction is started(activated) we assign:
but when removeAuctionConfig
is called for already activated auctions but still in cooldown period:
the function directly deletes the epoch and config before reducing the totalAuctionTokenAmount
.
This is a problem because when calling recoverToken
the maximum amount allowed to recover is calculated after deducting the allocated amounts from _totalAuctionTokenAllocation
:
Which means even after deleting an auction the tokens cannot be recovered nor can be used in the future auction because totalAuctionTokenAllocation
is also used for calculating how much tokens are assigned for the epoch.
Example:
Owner activates an auction with 1000 auction tokens.
info.totalAuctionTokenAmount = 1000,
_totalAuctionTokenAllocation[auctionToken] = 500(for previous auctions) + 1000 = 1500
auction still in cooldown period, owner decides to removeAuctionConifig
and recover tokens.
recoverToken
returns ```maxRecoverAmount = 1500 - (1500 - 0) = 0.
Thus funds cannot be recovered and are permanently stuck in the contract.
Once removeAuctionConfig is called for an auction in coolDown period, all the funds allocated to that auction will be permanently stuck in the contract. It cannot be recovered nor can it be used for future auctions.
manual
In removeAuctionConfig
add these lines in the first if statement;
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.