SafeTx is a beginner-friendly security layer that helps users spot common blockchain transaction risks before they click confirm.
Every day, users sign transactions they do not fully understand. Many scams look like normal wallet prompts, but actually request dangerous permissions (for example, unlimited token approvals).
Most people do not read raw contract data, function signatures, or network IDs. SafeTx converts technical transaction details into simple, human warnings.
On Ethereum and similar blockchains:
- Confirmed transactions are final.
- There is no "undo" button.
- If tokens are sent to the wrong address or stolen via malicious approval, recovery is very difficult.
That is why a pre-send safety check is critical.
SafeTx performs a lightweight safety pass in the browser:
- Validates wallet addresses.
- Detects the wallet's currently connected network.
- Compares selected network vs wallet network to prevent chain mistakes.
- Flags dangerous action patterns (unlimited approvals, transferFrom risk, suspicious signatures).
- Displays clear status as a traffic light:
- Green = Safe
- Yellow = Warning
- Red = Danger
- Modernized traffic-light safety UI (simple and beginner-friendly).
- Ethereum address validation with
ethers.js. - Wallet network detection via injected wallet provider.
- Network mismatch warning.
- Educational risk analysis with selectable risk models (Beginner, Balanced, Strict) for:
- Unlimited token approval
transferFromrisk- Unknown/suspicious function signatures
- Testnet-only Solidity demo contract showing safe vs dangerous approvals.
- Frontend: HTML, CSS, JavaScript
- Web3 library:
ethers.js(v6 via CDN) - Smart contract: Solidity
^0.8.20 - Target environment: Ethereum testnet (recommended: Sepolia)
frontend/
index.html
styles.css
app.js
contracts/
SafeApprovalDemo.sol
docs/
BEGINNER_EXPLANATION.md
README.md
- Clone repository.
- Open
frontend/index.htmlin a browser. - Install and unlock MetaMask (or compatible wallet).
- Switch wallet to the network you want (for example Sepolia).
- Enter a wallet address and choose network.
- Click Check Before Sending.
Note: This MVP is educational. It demonstrates core checks, not full production-grade security.
- Decode real pending transaction calldata directly from wallet prompts.
- Add known malicious contract list integration.
- Add simulation engine for transaction outcomes.
- Add scoring model with explainable risk factors.
- Add backend alerts + reputation feeds.
- Add unit/integration tests and CI pipeline.
Built for safer transaction decisions, better onboarding, and security-first Web3 UX.