Pandora-Labs-Org / erc404

402 stars 186 forks source link

What happens if allowance goes negative? #15

Closed 0xgizmob closed 9 months ago

0xgizmob commented 9 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 9 months ago

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