foundry
foundry copied to clipboard
`cast call` at specific transaction state
Component
Cast
Describe the feature you would like
Currently we can use --block
with cast call
to specify the state we want to execute the call at. It would be useful to simulate a call at a specific transaction state within a block. The use case we have is inspecting the exact state of market protocols immediately before transactions occur, where MEV activity causes changes earlier in the block making it more difficult for us to get accurate data.
This functionality already exists somewhat with cast run
forking and simulating the transactions up to the point of the target transaction (this is an assumption of the implementation and may be wrong ofc). As eth RPC APIs only allow specifying a block for the state, this might be more an extension to the --trace
form of cast call
as this implies the use of a local simulation, however I explicitly ask for cast call
, as the --trace
form does not decode the call result making it less useful for simple calls. It may be the case that this should be an extension to --trace
, and decoding the result in --trace
should be a separate feature.
Thanks
Additional context
No response