slither
slither copied to clipboard
Detect unused local variables (including in Yul blocks)
What bug did Slither miss and which detector did you anticipate would catch it?
- Clone the optimism repo and
cd packages/contracts-bedrock. - Open
L1Block.soland insetL1BlockValuesEcotone, notice the unusedlet data := calldataload(4). - Update the
slither.config.jsonso no checks are excluded. - Run
slither .(side error: runningslither ./src/L2/L1Block.solgives a compilation error that I haven't looked into yet), which does not find the unuseddatavariable.
Frequency
Not sure
Code example to reproduce the issue:
See above
Version:
0.10.0
Relevant log output:
No response
We have worked some on an unused-local detector but haven't released it due to FPs. Is there another detector you thought would catch this?
Ah, I thought I'd seen unused variables in the past but perhaps unused-state-variable is what I was remembering. In which case, we can convert this into a feature request