Description:Description\
In the function SendValueHelper::_sendValue(), if the ether balance of the contract is lower than the _amount to be sent, the transaction reverts with the custom error named AmountTooSmall() .
This is misleading, as the _amount is precisely too large for the contract balance, or the balance is too small for the _amount.
contract SendValueHelper {
bool public sendingProgress;
function _sendValue(address _recipient, uint256 _amount) internal {
if (address(this).balance < _amount) {
revert AmountTooSmall();
}
// ...
Suggestion
Change the custom error to either AmountTooLarge() or BalanceTooLow()
Severity
This is clearly not a medium finding, but a low one.
Github username: @JacoboLansac Twitter username: jacolansac Submission hash (on-chain): 0x4b8ce5a37a9134a4f40549066136d4bf3006b90c54e244e92c4a0a79aea9bbe2 Severity: medium
Description: Description\ In the function
SendValueHelper::_sendValue()
, if the ether balance of the contract is lower than the_amount
to be sent, the transaction reverts with the custom error namedAmountTooSmall()
.This is misleading, as the
_amount
is precisely too large for the contract balance, or the balance is too small for the_amount
.Suggestion Change the custom error to either
AmountTooLarge()
orBalanceTooLow()
Severity This is clearly not a medium finding, but a low one.