protec
protec copied to clipboard
An Isolated Safe Environment to Execute Foundry Projects.
protec •

Safely Execute Foreign Function Interface Commands.
Warning
This repo contains highly experimental code. Expect rapid iteration.
The current implementation does not currently work since environment variables are not refreshed.
What?
protec is a wrapper to prevent library abuse of the foundry's fii command. It attempts to completely block any call by setting the FOUNDRY_FFI environment variable to false.
Installation
forge install abigger87/protec
Usage
- Add this import to your script or test:
import {Protec} from "protec/Protec.sol";
- Inherit the Protec contract (eg in a test):
contract MyContract is Test, Protec {
// ...
}
- That's it! Any call to
vm.ffithat libraries perform will revert.