Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 6 additions & 33 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -32,54 +32,27 @@ ALCHEMY_API_KEY=your_alchemy_api_key
# IMPORTANT: Set this in your .env.local for development!
NEXT_PUBLIC_ENABLE_TESTNET_CHAINS=false

# EVM payment wallet address (same address used across all EVM chains)
# This is where users send their stablecoin payments on Ethereum, Base, Arbitrum, Optimism, Polygon
# EVM payment wallet address (used for Ethereum mainnet payments)
# This is where users send their stablecoin payments on Ethereum mainnet
# NEXT_PUBLIC_ prefix is required because it's displayed in the browser UI
# Format: 0x... (42 characters, EVM address)
# Note: For future non-EVM chains (Solana, Monad, etc.), add separate variables like:
# NEXT_PUBLIC_SOLANA_PAYMENT_WALLET_ADDRESS, NEXT_PUBLIC_MONAD_PAYMENT_WALLET_ADDRESS
NEXT_PUBLIC_EVM_PAYMENT_WALLET_ADDRESS=0x0000000000000000000000000000000000000000

# Stablecoin contract addresses (standard addresses, don't change unless deploying new token)
# Stablecoin contract addresses (standard addresses for Ethereum mainnet)

# USDC contracts
# USDC contract (Ethereum mainnet)
USDC_CONTRACT_ETHEREUM=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
USDC_CONTRACT_BASE=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
USDC_CONTRACT_ARBITRUM=0xaf88d065e77c8cC2239327C5EDb3A432268e5831
USDC_CONTRACT_OPTIMISM=0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
USDC_CONTRACT_POLYGON=0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359

NEXT_PUBLIC_USDC_CONTRACT_ETHEREUM=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
NEXT_PUBLIC_USDC_CONTRACT_BASE=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
NEXT_PUBLIC_USDC_CONTRACT_ARBITRUM=0xaf88d065e77c8cC2239327C5EDb3A432268e5831
NEXT_PUBLIC_USDC_CONTRACT_OPTIMISM=0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
NEXT_PUBLIC_USDC_CONTRACT_POLYGON=0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359

# USDT contracts
# USDT contract (Ethereum mainnet)
USDT_CONTRACT_ETHEREUM=0xdAC17F958D2ee523a2206206994597C13D831ec7
USDT_CONTRACT_BASE=0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2
USDT_CONTRACT_ARBITRUM=0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9
USDT_CONTRACT_OPTIMISM=0x94b008aA00579c1307B0EF2c499aD98a8ce58e58
USDT_CONTRACT_POLYGON=0xc2132D05D31c914a87C6611C10748AEb04B58e8F

NEXT_PUBLIC_USDT_CONTRACT_ETHEREUM=0xdAC17F958D2ee523a2206206994597C13D831ec7
NEXT_PUBLIC_USDT_CONTRACT_BASE=0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2
NEXT_PUBLIC_USDT_CONTRACT_ARBITRUM=0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9
NEXT_PUBLIC_USDT_CONTRACT_OPTIMISM=0x94b008aA00579c1307B0EF2c499aD98a8ce58e58
NEXT_PUBLIC_USDT_CONTRACT_POLYGON=0xc2132D05D31c914a87C6611C10748AEb04B58e8F

# DAI contracts
# DAI contract (Ethereum mainnet)
DAI_CONTRACT_ETHEREUM=0x6B175474E89094C44Da98b954EedeAC495271d0F
DAI_CONTRACT_BASE=0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb
DAI_CONTRACT_ARBITRUM=0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1
DAI_CONTRACT_OPTIMISM=0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1
DAI_CONTRACT_POLYGON=0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063

NEXT_PUBLIC_DAI_CONTRACT_ETHEREUM=0x6B175474E89094C44Da98b954EedeAC495271d0F
NEXT_PUBLIC_DAI_CONTRACT_BASE=0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb
NEXT_PUBLIC_DAI_CONTRACT_ARBITRUM=0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1
NEXT_PUBLIC_DAI_CONTRACT_OPTIMISM=0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1
NEXT_PUBLIC_DAI_CONTRACT_POLYGON=0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063

# Sepolia Testnet (DEV MODE ONLY - NODE_ENV=development)
# Get testnet tokens from Sepolia faucets (see STABLECOIN_PAYMENTS.md)
Expand Down
13 changes: 4 additions & 9 deletions STABLECOIN_PAYMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Monadic DNA Explorer Premium now uses a **database-free, stablecoin-based paymen
┌─────────────┐
│ Blockchain │ Ethereum, Base, Arbitrum, Optimism, Polygon
│ Blockchain │ Ethereum mainnet
│ Transaction │ Stablecoin transfer
└──────┬──────┘
Expand Down Expand Up @@ -73,17 +73,13 @@ NEXT_PUBLIC_DYNAMIC_ENVIRONMENT_ID=your_dynamic_environment_id

### 2. Supported Chains

The system supports 5 EVM chains (production):
- **Ethereum**
- **Base**
- **Arbitrum**
- **Optimism**
- **Polygon**
The system supports **Ethereum mainnet** only (no L2 networks):
- **Ethereum** (L1)

The system also supports **Sepolia testnet** when explicitly enabled:
- **Sepolia** (Ethereum testnet) - Enable by setting `NEXT_PUBLIC_ENABLE_TESTNET_CHAINS=true` in `.env.local`

**USDC**, **USDT**, and **DAI** are accepted on all chains.
**USDC**, **USDT**, and **DAI** are accepted on Ethereum mainnet.

### 3. Pricing Model

Expand Down Expand Up @@ -270,7 +266,6 @@ If you were using the old Paddle + Database system:
Potential improvements:
- [ ] Add email notifications when subscription expires
- [ ] Add QR code for mobile wallet payments
- [ ] Support more chains (Polygon, Avalanche, etc.)
- [ ] Add token price charts in UI
- [ ] Add refund mechanism (for accidental overpayments)

Expand Down
3 changes: 1 addition & 2 deletions app/api/nilai-delegation/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NextRequest, NextResponse } from 'next/server';
import { DelegationTokenServer, NilAuthInstance } from '@nillion/nilai-ts';
import { DelegationTokenServer } from '@nillion/nilai-ts';
import { validateOrigin } from '@/lib/origin-validator';

// Simple in-memory rate limiter
Expand Down Expand Up @@ -97,7 +97,6 @@ export async function POST(request: NextRequest) {

// Create delegation token server
const server = new DelegationTokenServer(apiKey, {
nilauthInstance: NilAuthInstance.PRODUCTION,
expirationTime: 600, // 10 minutes validity
tokenMaxUses: 1 // Single use for privacy (fresh token fetched per message)
});
Expand Down
151 changes: 0 additions & 151 deletions app/api/nildb-delegation/route.ts

This file was deleted.

2 changes: 1 addition & 1 deletion app/api/study-metadata/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export async function GET(request: NextRequest) {
date,
journal
FROM gwas_catalog
WHERE id = ?
WHERE id = $1
`;

const metadata = await executeQuerySingle<{
Expand Down
11 changes: 0 additions & 11 deletions app/components/MenuBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,17 +288,6 @@ export default function MenuBar() {
<span className="label">Help</span>
</button>

<button
className="menu-icon-button"
onClick={() => setShowNillionModal(true)}
title="x Nillion: Test your crypto degen score"
>
<span className="icon">
<NillionIcon size={32} />
</span>
<span className="label">x Nillion</span>
</button>

{mounted && (
<button
className="menu-icon-button"
Expand Down
5 changes: 5 additions & 0 deletions app/components/NillionModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ export default function NillionModal({ isOpen, onClose }: NillionModalProps) {

setCalculationStep('Storing results in nilDB...');

// nilDB functionality temporarily disabled - packages under migration
throw new Error('nilDB storage is temporarily unavailable during package migration');

/* DISABLED - nilDB code under migration
// Import nilDB client libraries dynamically (client-side only)
const { Signer } = await import('@nillion/nuc');
const { SecretVaultUserClient } = await import('@nillion/secretvaults');
Expand Down Expand Up @@ -174,6 +178,7 @@ export default function NillionModal({ isOpen, onClose }: NillionModalProps) {
);

console.log('Successfully stored in nilDB:', record._id);
*/

} catch (error) {
// Throw error to make nilDB failures visible
Expand Down
22 changes: 1 addition & 21 deletions app/components/PaymentModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useState, useEffect } from 'react';
import { useDynamicContext } from '@dynamic-labs/sdk-react-core';
import { parseUnits, encodeFunctionData, createPublicClient, http, formatUnits } from 'viem';
import { mainnet, base, arbitrum, optimism, polygon, sepolia } from 'viem/chains';
import { mainnet, sepolia } from 'viem/chains';
import { verifyPromoCode } from '@/lib/prime-verification';
import { setPromoAccess } from '@/lib/promo-access';
import StripeSubscriptionForm from './StripeSubscriptionForm';
Expand Down Expand Up @@ -39,10 +39,6 @@ export default function PaymentModal({ isOpen, onClose, onSuccess }: PaymentModa
// Block explorer URLs for each chain
const BLOCK_EXPLORERS: Record<string, string> = {
'Ethereum': 'https://etherscan.io',
'Base': 'https://basescan.org',
'Arbitrum One': 'https://arbiscan.io',
'OP Mainnet': 'https://optimistic.etherscan.io',
'Polygon': 'https://polygonscan.com',
'Sepolia': 'https://sepolia.etherscan.io',
};

Expand All @@ -53,32 +49,20 @@ export default function PaymentModal({ isOpen, onClose, onSuccess }: PaymentModa

const USDC_CONTRACTS: Record<string, string> = {
'Ethereum': process.env.NEXT_PUBLIC_USDC_CONTRACT_ETHEREUM || '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
'Base': process.env.NEXT_PUBLIC_USDC_CONTRACT_BASE || '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
'Arbitrum One': process.env.NEXT_PUBLIC_USDC_CONTRACT_ARBITRUM || '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
'OP Mainnet': process.env.NEXT_PUBLIC_USDC_CONTRACT_OPTIMISM || '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85',
'Polygon': process.env.NEXT_PUBLIC_USDC_CONTRACT_POLYGON || '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',
...(testnetEnabled ? {
'Sepolia': process.env.NEXT_PUBLIC_USDC_CONTRACT_SEPOLIA || '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238',
} : {}),
};

const USDT_CONTRACTS: Record<string, string> = {
'Ethereum': process.env.NEXT_PUBLIC_USDT_CONTRACT_ETHEREUM || '0xdAC17F958D2ee523a2206206994597C13D831ec7',
'Base': process.env.NEXT_PUBLIC_USDT_CONTRACT_BASE || '0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2',
'Arbitrum One': process.env.NEXT_PUBLIC_USDT_CONTRACT_ARBITRUM || '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9',
'OP Mainnet': process.env.NEXT_PUBLIC_USDT_CONTRACT_OPTIMISM || '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58',
'Polygon': process.env.NEXT_PUBLIC_USDT_CONTRACT_POLYGON || '0xc2132D05D31c914a87C6611C10748AEb04B58e8F',
...(testnetEnabled ? {
'Sepolia': process.env.NEXT_PUBLIC_USDT_CONTRACT_SEPOLIA || '0xaA8E23Fb1079EA71e0a56F48a2aA51851D8433D0',
} : {}),
};

const DAI_CONTRACTS: Record<string, string> = {
'Ethereum': process.env.NEXT_PUBLIC_DAI_CONTRACT_ETHEREUM || '0x6B175474E89094C44Da98b954EedeAC495271d0F',
'Base': process.env.NEXT_PUBLIC_DAI_CONTRACT_BASE || '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb',
'Arbitrum One': process.env.NEXT_PUBLIC_DAI_CONTRACT_ARBITRUM || '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1',
'OP Mainnet': process.env.NEXT_PUBLIC_DAI_CONTRACT_OPTIMISM || '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1',
'Polygon': process.env.NEXT_PUBLIC_DAI_CONTRACT_POLYGON || '0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063',
...(testnetEnabled ? {
'Sepolia': process.env.NEXT_PUBLIC_DAI_CONTRACT_SEPOLIA || '0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357',
} : {}),
Expand All @@ -87,10 +71,6 @@ export default function PaymentModal({ isOpen, onClose, onSuccess }: PaymentModa
// Map chain names to viem chain objects
const CHAIN_MAP: Record<string, any> = {
'Ethereum': mainnet,
'Base': base,
'Arbitrum One': arbitrum,
'OP Mainnet': optimism,
'Polygon': polygon,
...(testnetEnabled ? {
'Sepolia': sepolia,
} : {}),
Expand Down
Loading
Loading