Prevent failure when executed with a project not using `Vm`

pull/2413/head
Alexis 8 months ago
parent 7b9f543918
commit 2f0f8ccb47
No known key found for this signature in database
  1. 5
      slither/printers/summary/cheatcodes.py

@ -23,7 +23,10 @@ class CheatcodePrinter(AbstractPrinter):
info: str = ""
vm = self.slither.get_contract_from_name("Vm").pop()
try:
vm = self.slither.get_contract_from_name("Vm").pop()
except IndexError:
return output.Output("No contract named VM found")
for contract in self.slither.contracts_derived:
# Check that the IS_TEST variable is set. (Only works for Foundry)

Loading…
Cancel
Save