KRON — Project Overview
KRON is a hybrid decentralized/centralized NFT trading network built on the Polygon blockchain. It combines on-chain NFT transactions with a centralized backend for managing users, referral trees, and income tracking.
ℹ️ Only three types of transactions are on-chain: NFT minting (subscription), NFT trades (buy/sell), and burn events. All other activities (referral tracking, income calculation, user profiles) are off-chain in MySQL.
Core Mechanics
- New member pays 150 USDT subscription → smart contract mints 2 NFTs
- NFT-1 (75 USDT) listed at 85 USDT; NFT-2 (1 USDT) listed at 40 USDT
- Trading must occur within 24 hours or income is penalized
- When NFT value reaches 120 USDT, it is burned and the cycle resets
- Members earn referral income from up to 10 levels of downline
- Fund distribution is handled automatically by smart contract according to tokenomics
System Architecture
┌─────────────────────────────────────────────────────────┐
│ KRON ARCHITECTURE │
├─────────────────────────────────────────────────────────┤
│ Browser (HTML/CSS/JS) │
│ ├── index.html (Landing page) │
│ ├── dashboard.html (User dashboard) │
│ ├── admin.html (Admin panel) │
│ └── MetaMask (Web3 wallet) │
│ │ │
│ ▼ │
│ FastAPI Backend (Python) │
│ ├── /api/users (User management) │
│ ├── /api/income (Earnings calc) │
│ ├── /api/referrals (Network tree) │
│ ├── /api/admin (Admin controls) │
│ └── /api/webhook (Blockchain events) │
│ │ │ │
│ ▼ ▼ │
│ MySQL Database Polygon Blockchain │
│ (Users, Income, (NFT Mint, Trade, │
│ Referrals, etc.) Burn, Subscription) │
└─────────────────────────────────────────────────────────┘
Tech Stack
| Layer | Technology | Purpose |
| Frontend | HTML5, CSS3, Vanilla JS | All UI pages |
| Backend | FastAPI (Python 3.11+) | REST API, business logic |
| Database | MySQL 8.0+ | Users, referrals, income, off-chain data |
| Blockchain | Polygon (MATIC) | NFT minting, trades, burns (ERC-721) |
| Wallet | MetaMask | User & admin authentication |
| Web3 | ethers.js v6 | Blockchain interaction in browser |
| ORM | SQLAlchemy + Alembic | DB models and migrations |
| Smart Contract | Solidity 0.8+ | NFT ERC-721 + fund distribution |
File Structure
kron/
├── frontend/
│ ├── index.html
│ ├── dashboard.html
│ ├── admin.html
│ ├── docs.html
│ ├── style.css
│ ├── dashboard.css
│ ├── admin.css
│ ├── app.js
│ ├── dashboard.js
│ └── admin.js
├── backend/
│ ├── main.py
│ ├── config.py
│ ├── models/
│ │ ├── user.py
│ │ ├── nft.py
│ │ ├── income.py
│ │ └── transaction.py
│ ├── routers/
│ │ ├── users.py
│ │ ├── income.py
│ │ ├── referrals.py
│ │ ├── admin.py
│ │ └── webhook.py
│ ├── services/
│ │ ├── income_engine.py
│ │ └── polygon_listener.py
│ └── database.py
├── contracts/
│ ├── KronNFT.sol
│ └── KronFund.sol
├── .env
├── requirements.txt
└── README.md
Backend Setup (FastAPI)
1. Prerequisites
- Python 3.11 or higher
- MySQL 8.0+
- Node.js (for Hardhat/contract deployment)
2. Installation
git clone https://github.com/yourorg/kron.git
cd kron/backend
python -m venv venv
source venv/bin/activate
pip install fastapi uvicorn sqlalchemy pymysql python-dotenv
pip install web3 alembic pydantic[email] python-jose
3. Environment Variables (.env)
DATABASE_URL=mysql+pymysql://user:password@localhost/kron_db
SECRET_KEY=your-secret-key-here
POLYGON_RPC_URL=https://polygon-rpc.com
CONTRACT_ADDRESS=0x...your_contract_address
ADMIN_WALLET=0x...your_admin_wallet
4. Run the server
uvicorn main:app --reload --host 0.0.0.0 --port 8000
API Endpoints
| Method | Endpoint | Description |
| POST | /api/users/register | Register user with wallet address + referrer |
| GET | /api/users/{wallet} | Get user profile and stats |
| GET | /api/income/{wallet} | Get all income for a wallet |
| GET | /api/referrals/{wallet} | Get full referral tree (10 levels) |
| POST | /api/webhook/nft-minted | Called by smart contract on mint |
| POST | /api/webhook/nft-traded | Called by smart contract on trade |
| POST | /api/webhook/nft-burned | Called by smart contract on burn |
| POST | /api/admin/trade-mode | Set slow/fast mode (admin) |
| POST | /api/admin/daily-limit | Set daily trade limit (admin) |
| POST | /api/admin/buyback | Trigger buy back (admin) |
| GET | /api/admin/members | Get all members (admin) |
| PATCH | /api/admin/branding | Update logo/contact/social links |
MySQL Database Schema
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
wallet VARCHAR(42) UNIQUE NOT NULL,
referrer_wallet VARCHAR(42),
rank ENUM('none','bronze','silver','gold','platinum') DEFAULT 'none',
is_active BOOLEAN DEFAULT TRUE,
joined_at DATETIME DEFAULT NOW(),
subscription_expires DATETIME,
missed_days INT DEFAULT 0,
trade_mode ENUM('slow','fast') DEFAULT 'fast'
);
CREATE TABLE nfts (
id INT AUTO_INCREMENT PRIMARY KEY,
token_id VARCHAR(100) UNIQUE NOT NULL,
owner_wallet VARCHAR(42) NOT NULL,
mint_price DECIMAL(10,2),
current_price DECIMAL(10,2),
status ENUM('minted','listed','sold','burned'),
created_at DATETIME DEFAULT NOW(),
burned_at DATETIME NULL
);
CREATE TABLE income (
id INT AUTO_INCREMENT PRIMARY KEY,
wallet VARCHAR(42) NOT NULL,
source_wallet VARCHAR(42),
amount DECIMAL(10,2),
type ENUM('nft_sale','referral_l1','referral_l2','referral_l3',
'referral_l4','referral_deep','pairing_bonus','trading'),
level INT DEFAULT 1,
created_at DATETIME DEFAULT NOW()
);
CREATE TABLE transactions (
id INT AUTO_INCREMENT PRIMARY KEY,
tx_hash VARCHAR(100) UNIQUE NOT NULL,
wallet VARCHAR(42),
type ENUM('subscribe','nft_mint','nft_trade','nft_burn','buyback'),
amount DECIMAL(10,2),
block_number BIGINT,
created_at DATETIME DEFAULT NOW()
);
CREATE TABLE settings (
key_name VARCHAR(100) PRIMARY KEY,
value TEXT,
updated_at DATETIME DEFAULT NOW() ON UPDATE NOW()
);
INSERT INTO settings VALUES
('trade_mode', 'fast', NOW()),
('daily_limit', '5', NOW()),
('mint_price_nft1', '75', NOW()),
('mint_price_nft2', '1', NOW()),
('burn_threshold', '120', NOW()),
('subscription_fee', '150', NOW()),
('site_logo', '', NOW()),
('announcement', '', NOW());
Polygon Blockchain Setup
Adding Polygon to MetaMask
| Setting | Value |
| Network Name | Polygon Mainnet |
| RPC URL | https://polygon-rpc.com |
| Chain ID | 137 |
| Symbol | MATIC |
| Explorer | https://polygonscan.com |
💡 Users need MATIC for gas fees and USDT (on Polygon) for subscriptions and trades. USDT contract on Polygon: 0xc2132D05D31c914a87C6611C10748AEb04B58e8F
Smart Contract Overview
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract KronNFT is ERC721 {
address public admin;
IERC20 public usdt;
uint256 public subscriptionFee = 150 * 1e6;
uint256 public burnThreshold = 120 * 1e6;
uint256 public mintPriceNFT1 = 75 * 1e6;
uint256 public mintPriceNFT2 = 1 * 1e6;
address public burnWallet;
address public crisisFundWallet;
address public fundersWallet;
address public newProjectsWallet;
address public creatorWallet;
event NFTMinted(address indexed user, uint256 tokenId, uint256 price);
event NFTTraded(address indexed from, address indexed to, uint256 tokenId, uint256 price);
event NFTBurned(uint256 indexed tokenId);
function subscribe(address referrer) external {
usdt.transferFrom(msg.sender, address(this), subscriptionFee);
_distributeFunds(subscriptionFee, false);
_mintNFTs(msg.sender);
}
function _distributeFunds(uint256 amount, bool isProfit) internal {
uint256 burn = amount * 40 / 100;
uint256 crisis = isProfit ? amount * 30 / 100 : amount * 20 / 100;
}
}
NFT Transaction Flow
User clicks "Join" on website
→ MetaMask opens, user approves USDT transfer (150 USDT)
→ Smart contract: distributeFunds() → splits to 5 wallets
→ Smart contract: mintNFT1(75 USDT) + mintNFT2(1 USDT)
→ Events emitted: NFTMinted × 2
→ Backend webhook receives events
→ MySQL: user created, NFTs stored, subscription set
→ Frontend: redirect to dashboard
NFT Trade Flow:
User sells NFT-1 for 85 USDT
→ Buyer approves 85 USDT transfer
→ Smart contract: trade() transfers NFT + USDT
→ Event: NFTTraded(from, to, tokenId, price)
→ Backend: records trade, calculates referral income
→ Backend: distributes income to upline (up to 10 levels)
→ MySQL: income table updated for all eligible upline
Burn Flow:
NFT price reaches 120 USDT
→ Admin or auto-trigger: burn()
→ Event: NFTBurned(tokenId)
→ Backend: marks NFT as burned
→ Backend: triggers re-mint for owner (new cycle)
Income & Trading Rules
Referral Commission Table
| Level | Commission | Eligibility |
| L1 (Direct) | 5 USDT | Always active with active subscription |
| L2 | 3 USDT | Need ≥2 direct referrals |
| L3 | 3 USDT | Need ≥2 direct referrals |
| L4 | 4 USDT | Bronze rank required |
| L5–L10 | 1 USDT each | Bronze rank required |
Trading Rules
- 24-Hour Rule: If you miss trading in your window, your referral income for the next day is cut
- 17-Day Rule: Missing more than 3 days in a 17-day window stops all referral income. Max earnings capped at base 150 USDT
- Subscription Window: First subscription is valid for 18 days
- Pairing Bonus: 5 USDT earned when you achieve 2 direct referrals (a "pair")
- Missed Income: If you are inactive, your share goes to the Company Wallet
⚠️ The income_engine.py service must run daily (cron job) to recalculate member eligibility, check missed trading days, and update rank statuses.
Tokenomics & Fund Distribution
| Recipient | From Subscriptions | From Leveling Profit |
| 🔥 Burning (Deflation) | 40% | 40% |
| 🛡 Financial Crisis Fund | 20% | 30% |
| 👥 Funders | 20% | — |
| 🚀 New Projects | 10% | 20% |
| ⭐ Creator | 10% | 10% |
All fund distributions are executed automatically by the smart contract at the time of each transaction. No manual intervention is needed for routine distributions.
Admin Panel Guide
Accessing the Admin Panel
- Navigate to
admin.html
- Click "Connect MetaMask" and sign with the admin wallet address configured in
.env
- The backend verifies the wallet signature before allowing admin API calls
Key Admin Functions
- Trading Control: Toggle Slow/Fast mode; set daily trade limits; activate/deactivate specific Trade IDs; set minting prices
- NFT & Burn: Manually execute burn for a specific NFT token ID; trigger company buy back; update burn threshold and subscription fee
- Wallet Management: Update any of the 5 fund distribution wallet addresses (requires on-chain tx confirmation)
- Branding: Upload logo, update contact details, social media links, and announcement banners
- Security: Update admin wallet; pause/resume the entire system in emergencies
🔐 The admin wallet must be kept secure. Changing it requires an on-chain transaction from the current admin wallet. There is no recovery mechanism.
Deployment Guide
Production Checklist
- Deploy smart contract to Polygon Mainnet using Hardhat or Remix
- Set up MySQL 8.0 on your server (or use PlanetScale/AWS RDS)
- Configure
.env with production values
- Run
alembic upgrade head to create all tables
- Deploy FastAPI using Gunicorn + Nginx
- Point frontend files to your FastAPI API URL
- Set up a daily cron job to run
income_engine.py
- Configure a blockchain event listener (
polygon_listener.py) as a background service
- Enable HTTPS on all endpoints
gunicorn main:app -w 4 -k uvicorn.workers.UvicornWorker \
--bind 0.0.0.0:8000
0 0 * * * /path/to/venv/bin/python /path/to/income_engine.py
python polygon_listener.py