07 · Remittance, DeFi
SafarPay: UAE to Pakistan remittance rail as a set of Solidity contracts
- Client
- Independent project
- Industry
- Remittance, DeFi
- My part
- Smart contract engineer
- Status
- Contracts and Foundry test suite complete
Overview
SafarPay is a remittance rail for the UAE to Pakistan corridor, built as a set of five Solidity contracts. The corridor carries a lot of volume, and the traditional path is slow and expensive. The contracts model funding, transfer, settlement, fees and access control on-chain.
This was a contracts-first project. The point was to get the settlement logic right and to prove it with tests, not to build a front end.
What I built
- 01Five contracts with clear responsibilities and minimal cross-contract trust.
- 02A full Foundry suite: unit tests for every path, fuzz tests on amounts and fee math, and explicit tests for the failure and pause paths.
- 03Fee logic and access control designed so an operator can adjust parameters without being able to move user funds.
What was hard
Problem
Fee math that stays exact across amounts and rounding.
Approach
Fuzz-tested fee calculations with invariants on totals, so no combination of amount and rate leaks value.
Problem
Operator controls without operator custody.
Approach
Role-based access with separated permissions: parameters can be changed, funds cannot be redirected.