Drift is an onchain subscription protocol on Base. Creators set a price and period, subscribers pay in ETH, and payments go directly to the creator. No censorship, no middleman. The protocol takes a 2% platform fee.
- Creator sets up a plan — defines a price (in ETH), billing period (1 day to 365 days), name, and description.
- Subscriber pays — sends exact ETH amount to subscribe. Payment goes directly to the creator.
- Recurring payments — subscriber calls
pay()each period to continue access. The contract tracks payment status onchain. - Unsubscribe anytime — subscriber can cancel at any time. Creator can deactivate a plan (existing subs still honored).
- Smart Contract: Solidity 0.8.20, OpenZeppelin (Ownable, ReentrancyGuard)
- Frontend: Next.js 16, React 19, TypeScript, Tailwind CSS
- Web3: wagmi, viem, ConnectKit
- Chain: Base (Ethereum L2, Chain ID 8453)
- Tooling: Hardhat
drift/
├── contracts/
│ └── Drift.sol # Subscription smart contract
├── scripts/
│ └── deploy.js # Deployment script
├── frontend/
│ ├── app/ # Next.js app router
│ │ ├── page.tsx # Main subscription UI
│ │ ├── contract.ts # Contract ABI + address
│ │ ├── providers.tsx # Web3 providers (wagmi, ConnectKit)
│ │ └── api/ # API routes
│ └── public/ # Static assets
├── hardhat.config.js
└── package.json
npm install
npx hardhat compileTo deploy (requires .env with PRIVATE_KEY):
npx hardhat run scripts/deploy.js --network basecd frontend
pnpm install
pnpm devOpen http://localhost:3000.
- Fee: 2% (200 basis points) on every subscription payment
- Plans: Creator-defined price and period, activatable/deactivatable
- Subscriptions: Tracked onchain with
startedAt,lastPaidAt,nextDueAt - Security: ReentrancyGuard on all ETH transfers, Ownable for fee withdrawal
MIT