protofire / solhint

Solhint is an open-source project to provide a linting utility for Solidity code.
https://protofire.github.io/solhint/
MIT License
1.04k stars 161 forks source link

`gas-indexed-events` not working for Interfaces #569

Closed 0xCLARITY closed 7 months ago

0xCLARITY commented 8 months ago

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.


4. Look at code:
```solidity
pragma solidity ^0.8.20;

interface ICounter {
  event Increment (address indexed sender, uint256 indexed value);
}
  1. Be confused about alleged warnings.
dbale-altoros commented 7 months ago

jajaj thanks @0xCLARITY for your message will be fixing as soon as I can I think I missed interfaces... need to check

dbale-altoros commented 7 months ago

fixed in https://github.com/protofire/solhint/pull/573 already included in latest version 4.5.4