Is your feature request related to a problem? Please describe.
In invariant testing we have some set of contracts and selectors as targets from setUp(). But we cannot force this set of targets to be called from, for example, a symbolic callback handler.
Describe the solution you'd like
Add new cheatcode callTargetFromHere().
Reference is from here
fallback() external payable {
...
executeSymbolicallyAllTargets("fallback_target");
...
}
In the case of invariant testing callbacks processing may look like
fallback() external payable {
...
svm.callTargetFromHere()
...
}
This way we can access registered targets and call them from anywhere, minimizing mocks and pseudo-copies.
Describe alternatives you've considered
Add the --only_target_symbolic_address halmos parameter, which will force halmos to only substitute registered targets in the case of call to symbolic address. This is much harder, because you will also have to process symbolic calldata (replace symbolic bytes array with all constraints with bytes from createCalldata())
Is your feature request related to a problem? Please describe.
In invariant testing we have some set of contracts and selectors as targets from
setUp(). But we cannot force this set of targets to be called from, for example, a symbolic callback handler.Describe the solution you'd like
Add new cheatcode
callTargetFromHere().Reference is from here
In the case of invariant testing callbacks processing may look like
This way we can access registered targets and call them from anywhere, minimizing mocks and pseudo-copies.
Describe alternatives you've considered
Add the
--only_target_symbolic_addresshalmos parameter, which will force halmos to only substitute registered targets in the case of call to symbolic address. This is much harder, because you will also have to process symbolic calldata (replace symbolic bytes array with all constraints with bytes from createCalldata())