Skip to content

More use cases

As handler functions have access to the Foundry VM, handlers can modify contracts, simulate transactions, and much more. Some examples of what is possible:

  • A transaction handler function could modify the code of existing contracts by using vm.etch, and then simulate the matching transaction. The modified code could contain special events or perform additional logic that doesn't exist in the original contract, similar to what shadow.xyz does with shadow events (though the experience would be different and not designed for indexing data at scale).
  • ...