Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 24 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# Safe Multisig Transaction Hashes

This repository contains both a Bash script and a web interface for calculating Safe transaction hashes. It helps users verify transaction hashes before signing them on hardware wallets by retrieving transaction details from the Safe transaction service API and computing the domain and message hashes using the EIP-712 standard.
This repository contains a web interface for calculating Safe transaction hashes. It helps users verify transaction hashes before signing them on hardware wallets by retrieving transaction details from the Safe Transaction Service API and computing the domain and message hashes using the EIP712 standard.

The project is a fork of [@pcaversaccio](https://x.com/pcaversaccio) bash script, full details of such bash script README can be found at [its original reository](https://github.com/pcaversaccio/safe-tx-hashes-util/blob/main/README.md).
The UI also offers a second method to manually input transaction details instead of recovering them from Safe’s API.

All processing happens in your browser. When using the API method, your browser fetches read‑only transaction data directly from the Safe Transaction Service. For increased security, we recommend running the app locally on a trusted device.

This project is inspired by the `safe-tx-hashes-util` bash script developed by [@pcaversaccio](https://x.com/pcaversaccio). Full details can be found in its original repository: [github.com/pcaversaccio/safe-tx-hashes-util](https://github.com/pcaversaccio/safe-tx-hashes-util/blob/main/README.md).

The UI also offers a second method to manually input transaction details instead of recovering them from Safe's API.

## Disclaimer

This is a fork of a script by [@pcaversaccio](https://github.com/pcaversaccio/safe-tx-hashes-util) that adds a user interface. It has not been subject to any security assessment and is therefore not suitable for production use. Any use of the tool is at your own risk in accordance with our [Terms of Service](https://www.openzeppelin.com/tos).
Safe Utils has not been subject to any security assessment and is therefore not suitable for production use. Any use of the tool is at your own risk in accordance with our [Terms of Service](https://www.openzeppelin.com/tos).

This tool is intended to be used as a proof of concept and feedback and contributions are welcome. While there are few dependencies, you should always do your own investigation and [run the tool locally](https://github.com/openzeppelin/safe-utils?tab=readme-ov-file#run-locally) where possible.
This tool is intended to be used as a proof of concept, and feedback and contributions are welcome. While there are few dependencies, you should always do your own investigation and [run the tool locally](https://github.com/openzeppelin/safe-utils?tab=readme-ov-file#run-locally) where possible.

## Prerequisites

Before you begin, ensure you have the following installed:

- Node.js (version 14 or later)
- Node.js 18.17+ (20+ recommended)
- npm (usually comes with Node.js)

## Run locally
Expand All @@ -28,36 +31,39 @@ Before you begin, ensure you have the following installed:
cd safe-utils
```

2. Set up the `safe_hashes.sh` script:
- Ensure the `safe_hashes.sh` script is located in the parent directory of the app.
- Make the script executable:

```bash
chmod +x ../safe_hashes.sh
```

3. Install dependencies:
2. Install dependencies:

```bash
cd app/
npm install
```

4. Run the development server:
3. Run the development server:

```bash
npm run dev
```

5. Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
4. Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

5. Safe API Key usage (Optional)
If you have a Safe Transaction Service API key, you can use it to reduce the time between requests and improve reliability. This is optional — the app works without a key.

Steps:

- Copy the `.env.example` file to `.env` inside the `app/` directory.
- Set `SAFE_API_KEY` using a key obtained by following [Safe’s guide](https://docs.safe.global/core-api/how-to-use-api-keys).

Notes:
- Requests are made from your browser and include the header `Authorization: Bearer <token>`.
- Without a key, the app automatically throttles requests to lower the chance of hitting rate limits, but may still encounter 429 responses.
## Usage

For quick and easy access, you can use the hosted version of Safe Hash Preview at [https://safeutils.openzeppelin.com/](https://safeutils.openzeppelin.com/). This version is ready to use without any setup required.

How to use the application:

- Choose the calculation method, defaults to Manual Input. Alternative you can use Safe's API which requires less input.
- Choose the calculation method, defaults to Manual Input. Alternatively, you can use Safes API which requires less input.
- Select a network from the dropdown menu.
- Enter the Safe address.
- Fill the rest of the data according to your selected method.
Expand Down
4 changes: 3 additions & 1 deletion app/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
NEXT_PUBLIC_BASE_URL=http://localhost:3000
NEXT_PUBLIC_BASE_PATH=/safe
NEXT_PUBLIC_BASE_PATH=/safe
#https://docs.safe.global/core-api/how-to-use-api-keys
SAFE_API_KEY=your-api-key-here
85 changes: 0 additions & 85 deletions app/app/api/calculate-hashes/route.ts

This file was deleted.

Loading