Closed mds1 closed 7 months ago
I get the following message when running with disallow-partial
:
Traceback (most recent call last):
File "/Users/alpharush/tob/slither/slither/solc_parsing/declarations/contract.py", line 553, in _analyze_params_elements
if accessible_elements[element.full_name] != all_elements[element.canonical_name]:
KeyError: 'startMeasuringGas(string)'
I think this import alias with collision is the issue as if I rename the contract it works (there's a separate issue for ternaries) https://github.com/endaoment/endaoment-contracts-v2/blob/main/src/test/utils/DSTestPlus.sol#L4-L10
https://github.com/crytic/slither/blob/b96beeaa5742d5d7a862e964bc72b3cab67623f4/slither/solc_parsing/slither_compilation_unit_solc.py#L407-L409 This code here doesn't account for contract name collisions and returns the same contract. This causes a contract to be set as inheriting from itself. This becomes clear if you add an assertion that none of the ancestors contract id's match the contract https://github.com/crytic/slither/blob/b96beeaa5742d5d7a862e964bc72b3cab67623f4/slither/core/declarations/contract.py#L660-L662
Describe the issue:
Older versions of solmate's DSTestPlus have the below block of code (it's slightly modified in newer versions, and I haven't tested those). Even though we don't use the block of code in question, it causes the error shown below.
Logging the value of
ir
andvariable
inssa.py
'sget_variable
method prints the following right before the error:Since we were't using the code, I was able to comment out the problematic section and use slither, though I'm not sure of other workarounds if we were using it
Code example to reproduce the issue:
https://github.com/transmissions11/solmate/blob/44a9963d4c78111f77caa0e65d677b8b46d6f2e6/src/test/utils/DSTestPlus.sol#L15-L29
Version:
0.8.3
Relevant log output: