A drop-in CI security gate for the guard Foundry security checks. One GitHub Action step and a
scaffolded test turn each check into a red build when a contract regresses — no bespoke wiring per
project.
It ties together three check libraries, each shipping a correct and a deliberately-broken reference so the checks are proven to bite:
- v4-hookguard — Uniswap v4 hook footguns (unguarded callbacks, address-bitmap lint, "hook retains no value" invariant harness).
- superchain-interop-guard — Superchain interop (crosschain mint/burn auth, cross-domain context, two-chain supply-conservation harness).
- account-abstraction-guard — ERC-4337 / 7702 (execute() access control, UserOp signature validation, paymaster safety).
-
Scaffold a security test for your contract (pick the type that fits):
curl -sSL https://raw.githubusercontent.com/dngr2/guard-ci/main/bin/guard-scaffold -o guard-scaffold chmod +x guard-scaffold ./guard-scaffold paymaster MyPaymaster # -> test/security/MyPaymaster.security.t.solTypes:
hook,superchain-erc20,aa-account,paymaster. -
Install the matching guard and wire the one TODO (deploy your contract):
forge install dngr2/account-abstraction-guard foundry-rs/forge-std forge test --match-path "test/security/**/*.t.sol"
-
Gate CI — drop
templates/security.ymlinto.github/workflows/:- uses: dngr2/guard-ci@v1 with: test-path: test/security
That's it. Every push runs your security tests; a regression fails the build.
Complete, runnable example projects — each a scaffolded security test gating a correct contract, which turns red the moment you break it:
examples/paymaster— an ERC-4337 paymaster (EntryPoint-gated, bounded, safepostOp)examples/aa-account— a smart account (gatedexecute, validated UserOp signature)examples/superchain-erc20— a SuperchainERC20 (bridge-gated crosschain mint/burn)
| input | default | description |
|---|---|---|
test-path |
test/security |
directory of your guard security tests (all *.t.sol under it run) |
foundry-version |
stable |
Foundry toolchain version |
verbosity |
-vv |
forge test verbosity |
extra-args |
`` | extra args appended to forge test |
The checks only prevent losses if teams actually run them. guard-ci removes the integration cost:
scaffold, install, one CI step. It is a public good for anyone shipping a v4 hook, a SuperchainERC20,
or a smart account — MIT, no token, no fees.
Built by dngr2.