Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

janus

A Secure F1 Fan Engagement Hub & DEX

Inslallaion

Backend (Smart Contracts)

cd contracts
npm install

Environment Setup Create a .env file in the contracts directory:

cp .env.example .env

Development Workflow

  1. Compile Contracts
cd contracts # if not already present in janus/contracts
npx hardhat compile

This generates:

Contract artifacts in artifacts/ TypeScript types in typechain-types/

  1. 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
  1. 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 localhost

The local network provides:

10 test accounts with 10,000 ETH each Instant transaction confirmation No gas costs Ability to reset state

  1. 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
  1. Interact with Deployed Contracts
# Run interaction script
npx hardhat run scripts/interact.ts --network localhost

Deployment

Deploy to Localhost (Development)

# Start local node
npx hardhat node

# Deploy in another terminal
npx hardhat run scripts/deploy-single.ts --network localhost

Deploy 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 neondevnet

Deploy 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 neondevnet

Deploy to Neon MainNet (Production)

npx hardhat run scripts/deploy-single.ts --network neonmainnet

Avaiable Scripts

Contract Management

# Clean build artifacts
npx hardhat clean

# Compile contracts
npx hardhat compile

# Run tests
npx hardhat test

# Get contract size report
npx hardhat size-contracts

Deployment 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>

Network Configuration

Localhost (Development)

Neon DevNet (Public Testnet)

Neon MainNet (Production)

Contract Verification

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>

Testing

# Test all contracts in one go
npx hardhat test

# Test individual contracts
npx hardhat test test/JanusSwap.test.ts
...

About

A Secure F1 Fan Engagement Hub & DEX

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages