{"id":19147808,"url":"https://github.com/refcell/protec","last_synced_at":"2025-07-24T12:19:33.010Z","repository":{"id":44419096,"uuid":"512266565","full_name":"refcell/protec","owner":"refcell","description":"An Isolated Safe Environment to Execute Foundry Projects.","archived":false,"fork":false,"pushed_at":"2022-07-22T06:53:39.000Z","size":1233,"stargazers_count":44,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-20T06:58:23.299Z","etag":null,"topics":["ethereum","evm","foundry","solidity"],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/refcell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-09T19:14:04.000Z","updated_at":"2023-07-25T14:59:11.000Z","dependencies_parsed_at":"2022-07-14T21:30:32.929Z","dependency_job_id":null,"html_url":"https://github.com/refcell/protec","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/refcell/protec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fprotec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fprotec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fprotec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fprotec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/refcell","download_url":"https://codeload.github.com/refcell/protec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fprotec/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266842969,"owners_count":23993831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","evm","foundry","solidity"],"created_at":"2024-11-09T07:52:25.822Z","updated_at":"2025-07-24T12:19:32.971Z","avatar_url":"https://github.com/refcell.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"right\" width=\"150\" height=\"150\" top=\"100\" src=\"./assets/protected.png\"\u003e\n\n# protec • [![ci](https://github.com/abigger87/protec/actions/workflows/ci.yaml/badge.svg?label=ci)](https://github.com/abigger87/protec/actions/workflows/ci.yaml) [![license](https://img.shields.io/badge/License-Apache_2.0-blue.svg?label=license)](https://opensource.org/licenses/Apache-2.0) [![size](https://img.shields.io/github/languages/code-size/abigger87/protec.svg?color=orange\u0026label=size)](https://img.shields.io/github/languages/code-size/abigger87/protec?label=size)\n\nSafely Execute Foreign Function Interface Commands.\n\n\n\u003e **Warning**\n\u003e\n\u003e This repo contains **highly** experimental code. Expect rapid iteration.\n\u003e\n\u003e The current implementation does not currently work since environment variables are not refreshed.\n\n\n## What?\n\n**protec** is a wrapper to prevent library abuse of the [foundry](https://github.com/foundry-rs/foundry)'s [fii](https://book.getfoundry.sh/cheatcodes/ffi.html) command. It attempts to completely block any call by setting the `FOUNDRY_FFI` environment variable to `false`.\n\n\n## Installation\n\n```\nforge install abigger87/protec\n```\n\n## Usage\n\n\n1. Add this import to your script or test:\n```solidity\nimport {Protec} from \"protec/Protec.sol\";\n```\n\n2. Inherit the Protec contract (eg in a test):\n```solidity\ncontract MyContract is Test, Protec {\n  // ...\n}\n```\n\n3. That's it! Any call to `vm.ffi` that libraries perform will revert.\n\n\n## Acknowledgements\n\n- [Unix](https://github.com/abigger87/unix)\n- [Shannon](https://github.com/abigger87/shannon) _SOON™_\n- [Surl](https://github.com/memester-xyz/surl)\n- [Solenv](https://github.com/memester-xyz/solenv)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefcell%2Fprotec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefcell%2Fprotec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefcell%2Fprotec/lists"}