Pandora-Labs-Org / erc404

396 stars 185 forks source link

What happens if allowance goes negative? #15

Closed 0xgizmob closed 8 months ago

0xgizmob commented 8 months ago

From the transferFrom method, the line 235

if (allowed != type(uint256).max) {
        allowance[from_][msg.sender] = allowed - value;
      }

Should there be a check to ensure value < allowed, and revert if so?

caldereth commented 8 months ago

This will already revert due to underflow, so no need to explicitly check.