crytic / building-secure-contracts

Guidelines and training material to write secure smart contracts
https://secure-contracts.com/
GNU Affero General Public License v3.0
2.21k stars 345 forks source link

Added discussion on how and when to use cheat codes #257

Closed ggrieco-tob closed 1 year ago

ggrieco-tob commented 1 year ago

I would further include the example of vm.mockCall. Imo it is a big red flag if seen in tests. It has similar issues to vm.prank, however it further completely bypasses any business-logic and can easily break assumptions.

I think this should be part of another document on good testing practice, so we can discuss cheat codes that are not implemented in hevm/echidna.

ggrieco-tob commented 1 year ago

This one looks ready for another review or merging @montyly