foundry
foundry copied to clipboard
feat: add `vm.clearTransient`
Component
Forge
Describe the feature you would like
In solc version 0.8.24, transactions compose differently than message calls. While adding support for solc 0.8.24 (issue #6903) I think that it will be useful with a cheat code to clear the transient storage, so that we can model transactions with message calls.
For example a cheat code function clearTransientStorage(address)
to zero the transient storage. This cheat code can be used to model a transaction a.f(x)
with
vm.clearTransientStorage(address(a));
a.f(x);
vm.clearTransientStorage(address(a));
and transaction composition of a.f(x)
and a.g(y)
can be modeled with
vm.clearTransientStorage(address(a));
a.f(x);
vm.clearTransientStorage(address(a));
a.g(y);
vm.clearTransientStorage(address(a));
Additional context
No response