protec icon indicating copy to clipboard operation
protec copied to clipboard

An Isolated Safe Environment to Execute Foundry Projects.

protec • ci license size

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

  1. Add this import to your script or test:
import {Protec} from "protec/Protec.sol";
  1. Inherit the Protec contract (eg in a test):
contract MyContract is Test, Protec {
  // ...
}
  1. That's it! Any call to vm.ffi that libraries perform will revert.

Acknowledgements