Wrong error
message in register()::LLMOracleRegistry.sol
line 104.
https://github.com/Cyfrin/2024-10-swan-dria/blob/main/contracts/llm/LLMOracleRegistry.sol#L104
==> The error
shouldn't be InsufficientFunds()
but NotEnoughAllowance()
instead.
According to the comment this condition ensures that the user has enough allowance to stake.
If the allowance
is not enough (amount
> allowance), then revert
.
If the function reverts
with an InsufficientFunds()
error, the end user will think he has not enough funds, which is not correct.
Instead the error should indicate that he needs to allow enough for the contract to be able to transfer the correct amount
to stake.
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 users will also be impacted if they give back to the users the nature of the error message
or take any action regarding this specific error message
being wrong.
Github, Manual review.
Replace the code at line 104 :
=> with revert NotEnoughAllowance();
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.