Wrong error
message in relist()::Swan.sol
line 234.
https://github.com/Cyfrin/2024-10-swan-dria/blob/main/contracts/swan/Swan.sol#L234
==> error AssetLimitExceeded
is supposed to show the limit
to inform the end user of the actual AssetLimit to not exceed, instead this code gives the count
, which doesn't indicate at all how to correct the transaction to not revert again.
At each try from the end user, an error message will pop a different value as the "supposed limit to not exceed" being in fact the count
which won't help the end user, at contrary it will misinform him.
The error AssetLimitExceeded
is supposed to be as follow:
https://github.com/Cyfrin/2024-10-swan-dria/blob/main/contracts/swan/Swan.sol#L33-L34
Error messages
are there to lead the end user and/or the off chain Dapp connected to the smart contract.
A wrong error message
could mislead the end user trying to figure out why his transaction failed.
The off chain Dapps used by the end user will also be impacted if they give back wrong informations like a wrong limit
.
Github, Manual review.
Replace count
at line 234 with getCurrentMarketParameters().maxAssetCount
instead :
=>getCurrentMarketParameters().maxAssetCount
is the limit
.
Otherwise the end user will think that the actual count is the limit, he will never have
the information of what the AssetLimit (or maxAssetCount
) is and will be mislead by the error message.
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.