slither icon indicating copy to clipboard operation
slither copied to clipboard

optimize and make sure unused-imports is accurate

Open 0xalpharush opened this issue 1 year ago • 3 comments

It was added in https://github.com/crytic/slither/pull/2392 but it is really slow and has some edge cases e.g. this is wrong

The following unused import(s) in src/universal/CrossDomainMessenger.sol should be removed:
        -import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; (src/universal/CrossDomainMessenger.sol#4)

slither contracts.zip --detect unused-import contracts.zip

0xalpharush avatar Jun 05 '24 23:06 0xalpharush

@DarkaMaul Maybe you will have a chance to give this a go

0xalpharush avatar Jun 05 '24 23:06 0xalpharush

We may be able to use something like this to speed up the lookups https://pypi.org/project/intervaltree/

Also, we could look into something like Rowan's red-green trees

0xalpharush avatar Sep 04 '24 16:09 0xalpharush

Yeah this would be great, we're looking to check for unused imports to keep things clean https://github.com/ethereum-optimism/optimism/issues/11806

smartcontracts avatar Sep 19 '24 03:09 smartcontracts