Noticed a mismatched in the expected unit values between the voucher.minPrice and msg.value -
voucher.minPrice is implied to be in ETH - so values like .5, 1, 10 (generally single or double digit) are assumed to be ok.
msg.value is in WEI so require(msg.value >= voucher.minPrice, "Insufficient funds to redeem"); will more or less always be true.
If you attempt to set voucher.minPrice to a value in WEI then this causes an overflow bug in most cases because 1 ETH in WEI will exceed the MAX_SAFE_INTERGER value in javascript.
Noticed a mismatched in the expected unit values between the voucher.minPrice and msg.value -
voucher.minPrice is implied to be in ETH - so values like .5, 1, 10 (generally single or double digit) are assumed to be ok.
msg.value is in WEI so
require(msg.value >= voucher.minPrice, "Insufficient funds to redeem");
will more or less always be true.If you attempt to set voucher.minPrice to a value in WEI then this causes an overflow bug in most cases because 1 ETH in WEI will exceed the MAX_SAFE_INTERGER value in javascript.