solhint icon indicating copy to clipboard operation
solhint copied to clipboard

`gas-indexed-events` not working for Interfaces

Open 0xCLARITY opened this issue 11 months ago • 0 comments

PoC:

  1. Clone repo: https://github.com/0xCLARITY/solhint-testing
  2. Run yarn lint
  3. Observe "errors":
yarn lint
yarn run v1.22.21
$ solhint 'src/**/*.sol'

src/ICounter.sol
  4:3  warning  GC: [sender] on Event [Increment] could be Indexed  gas-indexed-events
  4:3  warning  GC: [value] on Event [Increment] could be Indexed   gas-indexed-events

✖ 2 problems (0 errors, 2 warnings)

✨  Done in 0.85s.
  1. Look at code:
pragma solidity ^0.8.20;

interface ICounter {
  event Increment (address indexed sender, uint256 indexed value);
}
  1. Be confused about alleged warnings.

0xCLARITY avatar Mar 19 '24 16:03 0xCLARITY