assert (false)and an additional log statement
emit AssertionFailed(".."). For example, given this annotated code:
viewfunction. In such cases adding an event
emitstatement changes the mutability of the instrumented function, which can change the interfaces of the compiled contracts and may break tests. For this reason
scribble(and Mythril and Harvey) support an alternative mode for signaling custom property violations using memory stores with specially crafted bitstrings. You can use this with the
--user-assert-mode mstorecommand line option. If you were to instrument our earlier exmaple in this mode the instrumented code would look as such:
_v.__mstore_scratch__on line 11. Tools such as Myhtril and Harvey can watch for assignments to memory with the
0xcafepattern appended with the id of the failing assertion.