A Secure F1 Fan Engagement Hub & DEX
Backend (Smart Contracts)
cd contracts
npm installEnvironment Setup
Create a .env file in the contracts directory:
cp .env.example .env- Compile Contracts
cd contracts # if not already present in janus/contracts
npx hardhat compileThis generates:
Contract artifacts in artifacts/ TypeScript types in typechain-types/
- Run Tests
# Run all tests
npx hardhat test
# Run with gas reporting
REPORT_GAS=true npx hardhat test
# Run specific test file
npx hardhat test test/JanusSwap.test.ts- Local Development Network Start a local Hardhat network for development:
# Terminal 1 - Start local node
npx hardhat node
# Terminal 2 - Deploy contracts to local network
npx hardhat run scripts/deploy-single.ts --network localhostThe local network provides:
10 test accounts with 10,000 ETH each Instant transaction confirmation No gas costs Ability to reset state
- Check Deployment Status
# View your wallet address
npx hardhat run scripts/show-address.ts --network localhost
# Check account balance
npx hardhat run scripts/check-balance.ts --network localhost
# View latest deployment info
cat deployments/latest.json- Interact with Deployed Contracts
# Run interaction script
npx hardhat run scripts/interact.ts --network localhostDeploy to Localhost (Development)
# Start local node
npx hardhat node
# Deploy in another terminal
npx hardhat run scripts/deploy-single.ts --network localhostDeploy to Neon DevNet (Testnet)
# Get test NEON tokens from https://neonfaucet.org/
# Check balance
npx hardhat run scripts/check-balance.ts --network neondevnet
# Deploy with minimal gas
npx hardhat run scripts/deploy-minimal.ts --network neondevnetDeploy to Neon DevNet (TestNet)
# Get test NEON tokens from https://neonfaucet.org/
# Check balance
npx hardhat run scripts/check-balance.ts --network neondevnet
# Deploy with minimal gas
npx hardhat run scripts/deploy-minimal.ts --network neondevnetDeploy to Neon MainNet (Production)
npx hardhat run scripts/deploy-single.ts --network neonmainnetContract Management
# Clean build artifacts
npx hardhat clean
# Compile contracts
npx hardhat compile
# Run tests
npx hardhat test
# Get contract size report
npx hardhat size-contractsDeployment Scripts
# Show wallet address
npx hardhat run scripts/show-address.ts --network <network>
# Check balance
npx hardhat run scripts/check-balance.ts --network <network>
# Deploy all contracts
npx hardhat run scripts/deploy-single.ts --network <network>
# Deploy with explicit gas settings
npx hardhat run scripts/deploy-minimal.ts --network <network>
# Interact with deployed contracts
npx hardhat run scripts/interact.ts --network <network>Localhost (Development)
- Chain ID: 31337
- RPC: http://127.0.0.1:8545
- Free, instant transactions
Neon DevNet (Public Testnet)
- Chain ID: 245022926
- RPC: https://devnet.neonevm.org
- Explorer: https://devnet.neonscan.org
- Faucet: https://neonfaucet.org/
Neon MainNet (Production)
- Chain ID: 245022934
- RPC: https://neon-proxy-mainnet.solana.p2p.org
- Explorer: https://neonscan.org
After deploying to a public network, verify contracts on NeoScan:
# Verify McLaren Token
npx hardhat verify --network neondevnet <TOKEN_ADDRESS> "McLaren Racing Token" "MCLAREN" 1000000
# Verify JanusSwap
npx hardhat verify --network neondevnet <SWAP_ADDRESS> <TOKEN_ADDRESS>
# Verify JanuPolis
npx hardhat verify --network neondevnet <POLIS_ADDRESS> <TOKEN_ADDRESS> <ORACLE_ADDRESS>
# Verify JanusAugur
npx hardhat verify --network neondevnet <AUGUR_ADDRESS> <TOKEN_ADDRESS> <ORACLE_ADDRESS># Test all contracts in one go
npx hardhat test
# Test individual contracts
npx hardhat test test/JanusSwap.test.ts
...