Abstraction over various EVM implementations via the Evm
trait. Currently
supported: Sputnik EVM and
Evmodin.
Any implementation of the EVM trait receives fuzzing support
using the proptest
crate.
In order to implement cheatcodes, we had to hook in EVM execution. This was done
by implementing a Handler
and overriding the call
function, in the
CheatcodeHandler
When testing, it is frequently a requirement to be able to fetch live state from e.g. Ethereum mainnet instead of redeploying the contracts locally yourself.
To assist with that, we provide 2 forking providers:
ForkMemoryBackend
: A simple provider which calls out to the remote node for any data that it does not have locally, and caching the result to avoid unnecessary extra requestsSharedBackend
: A backend which can be cheaply cloned and used in different tests, typically useful for test parallelization. Under the hood, it has a background worker which deduplicates any outgoing requests from each individual backend, while also sharing the return values and cache. This backend not in-use yet.