Skip to content

Choose a tag to compare

@pegahcarter pegahcarter released this 05 Aug 19:30
· 63 commits to main since this release
Immutable release. Only release title and notes can be modified.

Prove that a Gnosis Safe transaction is exactly the output of a specific Forge script — and was not manipulated on its way to the Safe.

First tagged release. The verifier has been in use and continuously self-attesting; this packages it for consumption from anyone's CI.

Use it as an action

- uses: actions/checkout@v4
- uses: xsafe/forge-attest@<commit-sha>
  with:
    config: attest.toml
    require-live: true

Put attest.toml in your ops repo, point producer_repo at it, and pin the values the script must produce.

Pin a commit SHA, not a tag. A tag is mutable, and whoever can move it decides what "verified" means in your pipeline — the exact property this tool exists to remove. A SHA pins the action, attest.sh, lib/, and the Solidity cross-check together, because they are one repository at one commit. The v1 tag exists for convention; the SHA is the recommendation.

What it checks

  1. Clones the producer at a pinned commit and verifies the checked-out SHA.
  2. Re-runs its Forge script.
  3. Hashes the emitted JSON against a pinned sha256.
  4. Normalises any supported Safe JSON shape — flat safe-tx, Transaction Builder batch, or bare tx-array — to one canonical SafeTx.
  5. Derives the EIP-712 digest two independent ways (cast and Solidity, folding batches separately so a bug in one cannot hide in the other).
  6. Optionally compares against what is actually queued, via the Safe Transaction Service.

Nested Safes are supported: the approval a child Safe must send is re-derived from the parent rather than read back from it, and the verdict states the nonce condition under which it stays valid.

Machine-readable verdicts

--json puts the verdict on stdout and the human report on stderr:

{
  "attested": true,
  "toolchain": { "forge": "1.7.1-stable", "producer_solc": "0.8.28" },
  "hashes": { "safe_tx": "0xd0e33f3b…", "canonical_sha256": "9057b9be…", "safe_tx_live": "" },
  "failures": []
}

A skipped check serialises as "" — an empty safe_tx_live means the live check did not run, which is not the same as passing.

Supply chain

  • Third-party actions pinned by commit SHA; Dependabot keeps them moving.
  • foundry-version defaults to a pinned release, not stable — forge re-runs the producer's script, so a moving toolchain can move the output bytes. The verdict records what actually ran, and expected_forge_version makes it enforceable.
  • Hash-critical lib/ files are checksummed in VENDORED.md and asserted by the test suite.

Requirements

git, Foundry (forge + cast), jq, sha256sum, bash. The action installs Foundry for you.

Licence

MIT, except lib/safe_hashes.sh, which is vendored from safe-tx-hashes-util and stays AGPL-3.0-only. See NOTICE. The four offline checks never invoke it.

Read before trusting it

forge-attest proves provenance, not intent — it cannot tell you a transaction does what you want. And running a claim runs the code it names: producer_setup is bash -c, so whoever can edit attest.toml executes code on the runner. Never wire it to pull_request_target. See the threat model in the README.