Ackee-Blockchain / solidity-for-vscode

Solidity language support & local node testing for VS Code
MIT License
38 stars 5 forks source link

Possible to mark errors as acknowledged? #78

Open mpeyfuss opened 8 months ago

mpeyfuss commented 8 months ago

I love the extension for vscode! It works great. There are a few detectors that come up as false alerts. Mainly, it happens for two scenarios:

  1. Doesn't recognize the nonReentrant modifier from OZ as stopping reentrancy
  2. Misreading an OZ IERC721 interaction as an ERC-20 interaction.

I don't mind the false detections coming up tbh, it's better to verify these, but it would be great to be able to mark as ack or resolved so that my files aren't marked as filled with errors.

Happy to discuss more or show how to replicate!

michprev commented 8 months ago

Hi @mpeyfuss, glad you like the extension!

You can disable/acknowledge errors using the // wake-disable- comments syntax. You can find the full description in the extension README or in the Wake documentation.

Regarding the false positives:

  1. Detecting reentrancy guard is non-trivial and might lead to false negatives (i.e. a missed detection). I agree we could at least try to detect the nonReentrant modifier using its name. Will consider that.
  2. Which detector reports these false positives? Is it unsafe-erc20-call or incorrect-interface?