ReferralGateway — white-label referral program for Web3
Production-ready stack: smart contract, Go API, Next.js UI, and monitoring. Go live in 2–4 weeks instead of 6–9 months of greenfield development.
About the product
ReferralGateway is an integration-ready package to launch a referral (affiliate / CPA) program on any EVM chain. You get a fraud-hardened smart contract, a Go backend with REST API and a blockchain indexer, a Next.js UI with dashboards for referrers, sellers, and admins, plus Prometheus + Grafana and CI/CD. Supported out of the box: BNB Chain, Polygon, zkSync Era, and other EVM networks.
Who it is for
The same segments as in our commercial proposal—from marketplaces to integrators.
Web3 marketplaces & DeFi
Referral payouts on-chain with full transparency—no spreadsheets or manual reconciliation; accruals and withdrawals via the smart contract.
Exchanges, wallets, Web3 fintech
Affiliate mechanics with holdTime, dispute arbitration, and any ERC-20 rewards (USDT, USDC, and more).
Agencies & integrators
White-label delivery: branding, docs, runbooks, and CI/CD so you can resell to clients with confidence.
Business value
Compared with building everything from scratch—benchmarks from real engagements.
| Criterion | Greenfield build | ReferralGateway |
|---|---|---|
| Time to launch | 6–9 months | 2–4 weeks |
| Budget benchmark | $150,000–350,000 | $25,000–50,000 (implementation) / buyout from $50,000 |
| Anti-fraud | Design from zero | holdTime + arbitration included |
| Contract audit | Separate contract & timeline | Hardened codebase; external audit optional |
| Monitoring & tests | Depends on the team | Prometheus/Grafana; contract coverage, E2E, k6 |
Delivery options
License + implementation
$25,000 – $50,000
Deploy in your infrastructure (Docker Compose / Kubernetes)
Contract deployment to chosen networks, UI branding, monitoring & alerts
DEPLOYMENT.md, runbooks; 3 months of Standard support included
Full source code buyout (IP)
$50,000 – $100,000
Full source: contract / backend / frontend
Unrestricted rights to modify and resell
1 month of handover support
Buyout + launch at your side
$65,000 – $120,000
Everything in Option B
Production rollout and onboarding for your team
Lower risk when you take over operations
Rollout phases
Week 1: qualification, fit/no-fit, NDA, pick a delivery option
Weeks 2–3: testnet deployment, scenario walkthrough, acceptance
Weeks 4–6: production rollout, monitoring, domains, TLS
Week 7: smoke tests, runbook handover, go-live
Typical production timeline: 4–7 weeks—depends on chain count and UI customization.
Support after launch
Standard and Business tiers are available post-implementation; details are fixed in the contract.
- Standard (DeFi/NFT): 8×5, P1 response within 1h, restore target up to 8h — from $1,500–$2,500 / mo
- Business (exchanges/fintech): 12×7, P1 within 1h, restore target up to 12h — from $3,000–$5,000 / mo
24×7 on-call and third-party smart-contract audits are scoped separately. SLA exclusions (chain, RPC, wallets) match the commercial proposal.
Strengths
Full stack: smart contract, Go REST API with SIWE/JWT, Next.js UI, iframe widget, Discord/Slack notifications.
On-chain flows: fixed-price offers, automatic seller / referrer / protocol split, any ERC-20 token.
Security: ReentrancyGuard, SafeERC20, timelocks on fee (24h) and arbitrator rotation (48h), Slither in CI.
Performance: ~3s indexer cadence, Redis cache, SingleFlight, RPC semaphore, target 1,000+ concurrent users; k6 SLOs shipped in-repo.
Quality & readiness
Contract: 100% Hardhat coverage, Foundry fuzzing, solvency invariant seller + referrer + protocol == price.
Backend: E2E full flow createOffer → buy → dispute → vote → claim; unit tests across auth, API, storage.
Frontend: Playwright smoke (login, offer, metadata); WalletConnect + MetaMask (Wagmi/Viem).
Infra: Docker Compose, Nginx, GitLab CI; Prometheus /metrics isolated from public access.
Local dev stack (~10–15 minutes)
After handover your engineers can boot the chain: contract → API via compose → Next.js.
Contract: install deps, start local chain, deploy the contract (Hardhat/Makefile).
Backend: in backend folder run `make docker-up`, verify `GET http://localhost:8096/health`.
Backend: if needed, run migrations (`make install-migrate && make migrate-up`).
Frontend: in frontend folder `npm i`, copy `.env.example` → `.env.local`, run `npm run dev` (port 3200).
Optional: set frontend proxy to backend (`NEXT_PUBLIC_API_PROXY_TARGET=http://localhost:8096`).
Solution Architecture
Smart Contracts (Solidity)
Solidity 0.8.x contracts for offers, buy/claim, arbitration, paginated rewards, Multicall; Foundry + Hardhat Ignition.
Backend API (Go)
Gin, GORM, PostgreSQL 15, Redis 7, go-ethereum; event indexer, rate limits, zerolog, OpenTelemetry.
Multi-chain Design
BNB Chain, Polygon, zkSync Era by default; add any EVM network via config (RPC, contract address, limits).
Key Features
Hold time & arbitration
Reward vesting, seller disputes, arbitrator votes; pause affects arbitration only—purchases and claims keep working.
Splits & protocol fee
Automatic seller / referrer / protocol split; fee updates guarded by a timelock.
Gas & throughput
Pagination and caps on claims, gas-limit safe batches; caching, SingleFlight, k6 scenarios with SLO thresholds in-repo.
BNB Chain, Polygon, zkSync Era, and any EVM network (config-driven)
Optimized contract; gas table per operation in the documentation
holdTime, arbitration, ReentrancyGuard, SafeERC20