Unlike the SpiceAuction
contract, which includes transaction fee checks for the bid token, the DaiGoldAuction
contract lacks such checks. This absence can lead to discrepancies in the expected token amounts during transfers, as it relies on the assumption that the bidToken has no funky fees or taxes. This oversight can cause financial discrepancies and potential losses for the protocol because the bidToken
is transferred to the DaiGoldAuction
contract itself in the bid
function.
In the documentation, theDaiGoldAuction
contract's bidToken
is assumed to have no internal taxes, fees, or callbacks:
"Bid token can be updated later using setBidToken
. It can be assumed that the bid token has no funky internal taxes or fees, callbacks or complex functionalities beyond the usual OZ ERC20 functions."
This assumption is documented but not enforced programmatically:
As seen in the code of the bid
function in DaiGoldAuction
contract the info.totalBidTokenAmount
is updated based on the amount (this value is used to decide the rewards later in the claim
function), but the actual amount received can be less if bidToken
has fees. This discrepancy can lead to losses for the protocol or other unexpected issues, if bidToken
has fees (accidentially or not).
The SpiceAuction
contract includes a check to verify that the transferred amount matches the expected amount, ensuring no transfer fees or other deductions occur:
This ensures that the transferred amount matches the expected amount, preventing issues with tokens that have transfer fees.
Same check has to be applied in DaiGoldAuction
.
Bear in mind thatbidToken
can't be reset before the epoch ends (this can be disturbing if update is required to avoid token with fees):
If a token with transfer fees is used as the bid token, the DaiGoldAuction
may receive less than expected in it's bid
function, leading to potential financial losses. Additionally, it will be impossible to change the bidToken
once users start using it, as they would have to wait for the current epoch to end.
It seems like likeihood is Medium because literally "It might occur under specific conditions. For example, a peculiar ERC20 token is used on the platform." In the context of the protocl token with funky fees is considered peculiar.
The impact seems like a high because the protocol can lose some assets because of the potential taxes.
Hence the severity is High.
Manual Review
DaiGoldAuction
contract has to apply the same check like the SpiceAuction
contract, to ensure the bid
function can't transfer bid tokens with fees:
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.