https://github.com/davidweb3-ctrl/minipay-spend-guard
Non-custodial MiniPay spend-limit and receipt proof for Celo Proof of Ship
https://github.com/davidweb3-ctrl/minipay-spend-guard
Last synced: 22 days ago
JSON representation
Non-custodial MiniPay spend-limit and receipt proof for Celo Proof of Ship
- Host: GitHub
- URL: https://github.com/davidweb3-ctrl/minipay-spend-guard
- Owner: davidweb3-ctrl
- Created: 2026-05-23T14:14:08.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-05-23T14:47:25.000Z (about 1 month ago)
- Last Synced: 2026-05-23T16:26:02.816Z (about 1 month ago)
- Language: TypeScript
- Size: 60.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MiniPay Spend Guard
MiniPay Spend Guard is a small Celo/MiniPay-compatible payment-safety proof.
It lets a user set a monthly spending limit and record merchant spend receipts onchain. The contract does not custody funds, does not route payments, and rejects native CELO transfers. It is intended as a narrow Proof of Ship submission artifact for payment policy, transparency, and user-facing spend controls.
## Why This Exists
Celo Proof of Ship rewards shipped products with measurable Celo activity. This project is intentionally scoped as a low-risk MiniPay-adjacent utility:
- non-custodial by design;
- useful for payment and merchant workflows;
- small enough to deploy and test quickly;
- built with Foundry tests and a Vite/Wagmi frontend using `viem`, not `ethers.js`.
## Contracts
```text
src/MiniPaySpendGuard.sol
```
Core actions:
- `setMonthlyLimit(uint256 limitCents)`
- `recordSpend(bytes32 merchantId, uint256 amountCents, string memo)`
- `getMonthState(address user, uint64 monthKey)`
## Run Tests
```bash
forge test -vv
```
## Frontend
```bash
cd app
pnpm install
pnpm build
```
The frontend uses injected wallets through Wagmi. Set the deployed contract address before building:
```bash
cp .env.example .env
VITE_CONTRACT_ADDRESS=0xYourCeloContract
```
## Celo Mainnet Deployment
Use a fresh development wallet with only a tiny amount of CELO for gas.
```bash
export PRIVATE_KEY=0x...
forge script script/DeployCelo.s.sol:DeployCelo \
--rpc-url https://forno.celo.org \
--chain-id 42220 \
--broadcast \
--verify
```
Do not use a wallet containing personal funds for development.
## Proof of Ship Notes
This project is not a production wallet, audit framework, custodial product, or DeFi strategy. It is a working public proof for:
- Celo mainnet contract deployment;
- open-source GitHub activity;
- MiniPay-compatible frontend dependencies;
- simple real-user spend safety UX.